Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 891 Bytes

README.md

File metadata and controls

28 lines (21 loc) · 891 Bytes

build-pubsub

A simplified implementation to learn how to build our own pubsub (publisher-subscriber pattern).

How do I learn?

source code: [build-pubsub]

Want to try

$ npm install build-pubsub

how to use

const Pubsub = require('build-pubsub');
const pubsub = new Pubsub();
pubsub.on('AJAX', ajaxFunc);
pubsub.on('AJAX', ajaxAnotherFunc);
pubsub.emit('AJAX', args); // fires both ajaxFunc & ajaxAnotherFunc with args

Some of the useful links to learn pubsub.