psst.js
This is yet another small Pub/Sub library, however unlike many other implementations, the subscribe method returns an object that describes the channel and callback.
Installing
$ npm install psst
var psst = ;
or
Using
psst.js supports both a single global listener (psst.on
), or many independent listeners (new psst()
).
var listener = ;
Subscribe/On
var subscription = listener;
var subscription = psst;
subscription
is a unique object that contains the channel and callback.
Subscribe Once
var subscription = listener;
var subscription = psst;
This subscription
is removed from the subscriber's list after the callback has been executed.
Unsubscribe/Off
listener;
psst;
Publish/Emit
listener;
psst;
License
Released under the MIT License: http://flesch.mit-license.org