Singleton Class Extended
Based on singleton-class.
The main change is remove the class initialize (new MyClass). The instance created on first `instance` getter call.
The constructor logic moved to __initialize
method.
Only allows one instance of the singleton to be created
Usage
npm install --save singleton-class-extended
- Extend the
Singleton
class with your own
const Singleton = ; { // Use this method as constructor thisname = 'bob'; // Do other things } console;