Created
February 15, 2016 15:40
-
-
Save catacs/c677768ec1e4f6da6b58 to your computer and use it in GitHub Desktop.
Singleton pattern javascript
This file contains 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
var Singleton = (function () { | |
var privateVariable = 'value'; | |
function privateFunction() { | |
} | |
function publicFunction() { | |
} | |
return { | |
publicFunction: publicFunction, | |
}; | |
})(); | |
// http://blog.mixu.net/2011/02/02/essential-node-js-patterns-and-snippets/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment