Skip to content

Instantly share code, notes, and snippets.

@thmsobrmlr
Created October 4, 2015 14:58
Show Gist options
  • Save thmsobrmlr/e9bf8cd17a01aa2e0f3e to your computer and use it in GitHub Desktop.
Save thmsobrmlr/e9bf8cd17a01aa2e0f3e to your computer and use it in GitHub Desktop.
ES6 Singleton
let instance = null;
class MySingleton {
constructor() {
if(!instance){
instance = this;
}
return instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment