oioi
v1.7.0
Published
A tiny pubsub implementation
Downloads
143
Readme
oioi
oioi (pronounced oy-oy) is a tiny pubsub library implementation
To use:
const oioi = require('oioi');
oioi.subscribe('hifive', function (data) {
console.log(data);
});
oioi.subscribe('hifive', function (data) {
console.log(data+'gotcha');
});
oioi.subscribe('random', function (data) {
console.log(data);
})
oioi.publish('hifive', 'raiseyourhands');
=> raiseyourhands
=> raiseyourhands gotcha
oioi.publish('random', Math.round(Math.random()*10));
=> a random whole number between 1 & 10