pubsubz
v0.0.1
Published
Simple publish/subscribe implementation
Readme
pubSubz
Simple pubsub implementation.
Installation
Using npm:
$ npm i --save pubsubzUsing cdn:
<script src="https://cdn.rawgit.com/tidupls/pubsubz/master/dist/pubsubz.min.js"></script>Using bower:
$ bower install pubsubzExample
function handler() {
console.log('Well hello there!');
}
// Subscribing to event:
pubSubz.subscribe('greet', handler);
// Can then publish
pubSubz.publish('greet'); // logs "Well hello there!"
// And remove if needed
pubSubz.unsubscribe('greet', handler);