reynok-event

1.0.5 • Public • Published

ReynokEvent

Reynok Event is a small event system which enables you to subscribe and emit events in browser or node runtime environment.

Usage / Example

Include it in your project:

let Event = require('reynok-event');

OR

import Event from 'reynok-event';

After that just subscribe to a event:

const EVENT_ID = Event.subscribe('my-event-name', function () {
           console.log('I will be executed when emitting the event');
       });

You can emit a event using:

ReynokEvent.emit('my-event-name');

Also events can be unsubscribed: Just use the EventID you get when subscribing to it.

Event.unsubscribe(EVENT_ID);

Readme

Keywords

Package Sidebar

Install

npm i reynok-event

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

6.49 kB

Total Files

5

Last publish

Collaborators

  • mrspace