Patterns
Design Patterns
Singleton
let instance;
Class Content{
constructor(){
if(instance){
throw new Error("You can only create one instance!");
}
}
}
let instance;
Class Content{
constructor(){
if(instance){
throw new Error("You can only create one instance!");
}
}
}