Pub/Sub library that keeps historical data. It's possible to publish before subscription then subscribe and get the data that was published.
pubsub.sub([ID], callback);
pubsub.sub('lorem', (data) => data);
pubsub.pub([ID], data);
pubsub.pub('lorem', 'ipsum');
pubsub.pub('lorem', { data: 'ipsum'});
You may pass multiple arguments to the subscription.
pubsub.pub('lorem', 'ipsum', 'dolor');
To unsubscribe from all subscriptions that has the ID "lorem".
pubsub.unsub('lorem');
To unsubscribe from only one subscription that has the ID "lorem".
pubsub.unsub('lorem', callback);