vigour-observable
Simple, extendable observables - does not require knowledge of flatmaps, reduce or event streams, inspired by rx-js and modelled as observ-struct.
Adds unqiue change stamps see vigour-stamp for more information
Inherits from vigour-base
operators and set
var Observable = var name = val: 'a name' return val var person = name: 'a name' personname // create an observing reference from person.name to namepersonname // fires the listener on person.name, logs "JAMES"name
on and off
var Observable = var fruits = fruits // this will fire the listener on fruitsfruits fruitsbanana // fires banana, does not fire for fruits (by default listeners do not fire for nested fields)fruitsbanana fruits // remove the kiwi and fires "any fruit?" and "fruits"fruitskiwi // you can make as many emitter types as you want// will add a listener to the emitter "purchase" with an identifier "history"fruits fruits // remove the listener on purchase with id historyfruits // removes all listeners on purchasefruits // adds the same listener using the object notationfruits