前端觀察者模式 observer

var Observer = function(){ this.callbacks=[]; }; Observer.prototype.subscribe = function(mes,callback,observer) { this.callbacks[mes] = this.callbacks[mes]||[] this.callbacks[mes].push({
相關文章
相關標籤/搜索