Created
September 16, 2016 09:45
-
-
Save thanpolas/66410030e093e2aebc8f19f7c325b327 to your computer and use it in GitHub Desktop.
ES6 Singleton Pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does it still work ? why let and not const ?