Class: createPublisher

lib/pubsub.createPublisher(subjectopt) → {module:lib/pubsub~Publisher}

new createPublisher(subjectopt) → {module:lib/pubsub~Publisher}

Factory method to create a new Publisher or for adding PubSub functionality to the given object. I.e. augments publish, publishSync, subscribe and unsubscribe methods.
Parameters:
Name Type Attributes Description
subject Object <optional>
If not given a plain Publisher object is returned
Source:
Returns:
Type
module:lib/pubsub~Publisher