Romuald Quantin (2017-02-09T14:41:34.000Z)
romu at soundstep.com (2017-02-09T14:45:57.593Z)
Usually solved this way: - export something to instantiate (a function or a class) ``` module.exports = MyClass; ``` - export an object (will be shared, only one instance) ``` module.exports = {}; ``` - export an object to facilitate the creation of a new instance every time it is called ``` module.exports = { create: () => { return new MyClass(); } }; ```
romu at soundstep.com (2017-02-09T14:45:05.625Z)
Usually solved this way: - export something to instantiate (a function or a class) ``` module.exports = MyClass; ``` - export an object (will be shared, only one instance) ``` module.exports = {}; ``` - export a new instance every time ``` module.exports = { create: () => { return new MyClass(); } }; ```