bricks/bricks/factory.js

19 lines
344 B
JavaScript
Raw Normal View History

2024-02-01 17:54:04 +08:00
var bricks = window.bricks || {};
2023-09-14 10:28:07 +08:00
class Factory_ {
constructor(){
this.widgets_kv = new Object();
this.widgets_kv['_t_'] = 1;
}
register(name, widget){
this.widgets_kv[name] = widget;
}
get(name){
if (this.widgets_kv.hasOwnProperty(name)){
return this.widgets_kv[name];
}
return null;
}
}
2024-02-01 16:40:31 +08:00
bricks.Factory = new Factory_();
2023-09-14 10:28:07 +08:00