Skip to content

Instantly share code, notes, and snippets.

@thanpolas
Created September 16, 2016 09:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thanpolas/66410030e093e2aebc8f19f7c325b327 to your computer and use it in GitHub Desktop.
Save thanpolas/66410030e093e2aebc8f19f7c325b327 to your computer and use it in GitHub Desktop.
ES6 Singleton Pattern
/**
* @fileOverview Singleton pattern on ES6.
*/
import logger from './logger.midd';
/**
* The class statement.
*
*/
class ClassStatement {
/**
* The Ctor.
*
*/
constructor() {
}
}
// singleton export
export let classStatement = new ClassStatement();
@DavidNorena
Copy link

DavidNorena commented Jul 30, 2017

Does it still work ? why let and not const ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment