Pubbie is a basic Pub/Sub Library. Handles your basics such as subscribing, publishing, and unsubscribing events/tokens.
var counter = 0,
func = function (arg) {
counter = arg || 1;
};
pubbie.subscribe('message', func);
pubbie.publish('message'); // counter === 1;
pubbie.publish('message', [2]); // counter === 2
pubbie.unsubscribe('message');
pubbie.publish('message'); // counter === 2 | Will remain at 2 as the function no longer exists.
NodeJS is required, once installed run npm install
in the directory to get all dependancies.
If you can't be bothered with the unit tests/building, just edit the source code found in the src/
folder.
Simply run grunt test
Once you've made the changes you wish to make to the source code, simply run grunt
to get a minified version
in the build folder.
Please feel free to open pull requests/issues regarding Pubbie.