transmitter
> Dead simple pub-sub
Last updated 10 years ago by goatslacker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install transmitter 
SYNC missed versions from official npm registry.

transmitter

Dead simple pub-sub

API

subscribe(onChange: () => any): { dispose: () => void }

Subscribes to change events. Returns an object which contains the method dispose which removes the current subscription.

publish(...payload: any): void

Emit a change to all the subscribers.

Example

const bus = transmitter()

bus.subscribe(result => console.log(result))

bus.publish({ foo: 'bar' })

License

MIT

Current Tags

  • 3.0.1                                ...           latest (10 years ago)

7 Versions

  • 3.0.1                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |