@janbloch/subscribable-event

1.0.2 • Public • Published

Subscribable

Example

const Subscribable = require('@janbloch/subscribable-event');

const event = new Subscribable();
const unsubscribe = event.subscribe((arg)=>{
    console.log('Hello ' + arg);
});

event.invoke('World');
unsubscribe();
event.invoke('This will not be printed to the console');

Output: Hello World

Package Sidebar

Install

npm i @janbloch/subscribable-event

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

1.2 kB

Total Files

3

Last publish

Collaborators

  • janbloch