【发布时间】:2014-06-17 08:30:10
【问题描述】:
是否可以在可观察对象上重载预先存在的订阅?如果可以,如何实现?
this.myObservable = ko.observable();
this.myObservable.subscribe(function(value){
/* stuff worth subscribing for */
});
/* stuff going on */
/* ... */
/* more stuff going on */
// now at this point I want to check if something has subscribed to
// this.myObservable and if so I want the subscription to do a bit extra
我知道我可以首先在初始订阅中放置“位额外”,但我想知道是否可以检查订阅然后重载它。
【问题讨论】:
标签: knockout.js subscription observable