0.0.2 • Published 6 years ago

@cherrypulp/pubsub v0.0.2

Weekly downloads
3
License
MIT
Repository
gitlab
Last release
6 years ago

PubSub

codebeat badge Issues License npm version

PubSub helper.

Installation

npm install @cherrypulp/pubsub

Quick start

import * as event from '@cherrypulp/pubsub';

// or

import {emit, off, on, once} from '@cherrypulp/pubsub';

Methods

emit

Publish to the given channel.

emit('channel', args);

off

Remove the given subscriber.

off('channel');

on

Subscribe to a new or existing channel.

on('channel', () => console.log('foo'));

once

Subscribe to a new or existing channel and remove the subscriber when published.

once('channel', () => console.log('bar'));

Versioning

Versioned using SemVer.

Contribution

Please raise an issue if you find any. Pull requests are welcome!

Author

License

This project is licensed under the MIT License - see the LICENSE file for details.

0.0.2

6 years ago

0.0.1

6 years ago