3.0.1 • Published 5 years ago

transmitter v3.0.1

Weekly downloads
8,065
License
MIT
Repository
github
Last release
5 years ago

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

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago