Bacon.js dispatcher
Bacon.Bus
powered simple dispatcher for reactive applications.Usage
npm install --save baconjs bacon-dispatcher
Attention: this module does not include Bacon.js so you must
install it in order to use this module.API
New dispatcher can be created with factory function:var dispatcher = require("bacon-dispatcher")
var d = dispather()
// ... use dipatcher instance "d" ...
.stream(name)
Returns Bacon stream for the given name. Creates a new stream if it does not exists. Subsequent calls return the same stream instance.var createItemS = d.stream("item:create")
.push(name, value)
Pushes the given value to the stream behind a given name. Creates a new stream if it does not exists behind the given name. Otherwise behaves exactly same as bus.push.```javascript d.push("item:create", {text: "tsers"})
### .plug(name, value)
Plugs the given stream to the stream behind a given name. Creates a new
stream if it does not exists behind the given name. Otherwise behaves
exactly same as [bus.push](http://baconjs.github.io/api.html#bus-plug).
```javascript
d.plug("item:saveToServer", Bacon.fromPromise(postAjax(item)))