-
Notifications
You must be signed in to change notification settings - Fork 62
PubSub Class
Ron Hashimoto edited this page Aug 24, 2016
·
9 revisions
PubSub provides a queued event channel.
import {PubSub} from 'dripcap';
let pubsub = new PubSub();
pubsub.pub('loaded', 'hello');
pubsub.sub('loaded', (msg) => {
console.log(msg);
});
let top = pubsub.get('loaded');Enqueues the data to the channel.
Parameter queue specifies the maximum queue size. 0 means no limitation.
Receives data from the channel.
Get queued data from the channel.
This documentation is licensed under a Creative Commons Attribution 3.0 Unported License.
