Socket
Socket
Sign inDemoInstall

bacon-dispatcher

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bacon-dispatcher

Simple Bacon.js event dispatcher by using Bacon.Bus


Version published
Maintainers
1
Install size
30.7 kB
Created

Readme

Source

Bacon.js dispatcher

Bacon.Bus powered simple dispatcher for reactive applications.

npm version Build Status

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.

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.

d.plug("item:saveToServer", Bacon.fromPromise(postAjax(item)))

License

MIT

Keywords

FAQs

Last updated on 31 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc