Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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