forked from varHarrie/varharrie.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Design Patternjs design patternjs design pattern
Description
A Singleton only allows for a single instantiation, but many instances of the same object. The Singleton restricts clients from creating multiple objects, after the first object created, it will return instances of itself.
const getSingle = function(fn){
let instance;
return function() {
return instance || (instance = fn.apply(this, arguments))
}
}Metadata
Metadata
Assignees
Labels
Design Patternjs design patternjs design pattern