Minimal observable. DOES NOT ADHERE TO ES7 OBSERVABLE SPEC.
$ npm install @f/observable
var observable = require('@f/observable')
var o = observable()
o.subscribe(function (next) {
console.log(next)
}) // => 1 , 2
o(1)
o(2)
Returns: observable
listener
- add listener with signaturelistener(nextVal)
Returns: unsubscribe function
val
- next value to send to listeners
Returns: Current value of the observable
MIT