iobserver
It's classical Observer pattern for any object.
Example
let user = name: 'slava' counter: 0 ; // mark it as observable ; assert; let usercounter+=payload; // this is just for example, but will be called on notify ; assert; // lets notify, it should inc call onNotify ; // yep counter updated assert; // once again ; // updated assert; // ok, lets unsubscribe, it should not receive calls now ; // fire ; //nothing changed assert; // once again ; //nothing assert;
Spec
const assert = ;const observable subscribe unsubscribe notify update = ; ;