Created
August 24, 2016 07:34
-
-
Save tzechienchu/3f45e7601fb6d9aa817fd428e21c3845 to your computer and use it in GitHub Desktop.
Javascript Singleton
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
var timeZoneService = (function () { | |
var instance; | |
function init() { | |
var prop | |
var method = function() { | |
} | |
return { | |
prop:prop, | |
method:method | |
} | |
} | |
return { | |
getInstance: function () { | |
if ( !instance ) { | |
instance = init(); | |
} | |
return instance; | |
} | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment