前端观察者模式 observer

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