pubSubz
Simple pubsub implementation.
Installation
Using npm:
$ npm i --save pubsubz
Using cdn:
<script src="https://cdn.rawgit.com/tidupls/pubsubz/master/dist/pubsubz.min.js"></script>
Using bower:
$ bower install pubsubz
Example
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);