1.0.3 • Published 9 years ago

leo-singleton-class v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

Singleton Class

Gears of Leo Singleton class to be extended from to create other singletons.

Only allows one instance of the singleton to be created

Usage

  • npm install --save leo-singleton-class
  • Extend the Singleton class with your own
const Singleton = require('leo-singleton-class');

class MyClass extends Singleton {
  constructor(name){
    super();
    this.name = name;
    // Do other things
  }
}

const item = new MyClass('bob');
console.log(item.name); // bob
1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago