0.1.3 • Published 4 years ago

state-subscriber v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

state-subscriber

A wrapper library to get the last state on listening. Its pretty much like event listening, but I've added more methods like subscribe and next to get the recent value of the event right on subscription.

Installation

Use npm install -S state-subscriber or yarn add state-subscriber to install the package.

Usage

Instead of using this.emit('event', data) you can use this.next('event', data). This will provide the value for the subscribe function. To get this value right at the subscription you can use this.subscribe('event') instead of this.on.

If you want, you can use it like

export class Test extends StateSubscriber {}

or like

const event = new StateSubscriber();

License

MIT

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago