Show:

Module: pubsub/eventbox

pubsub/eventbox

Eventbox pubsub module.

See:

Extends

Methods

publish(topic, data){uijet}

modules/pubsub/eventbox.js, line 21

Publish an event.

Name Type Description
topic string

type of event to publish.

data * optional

data to send to the registered handlers.

See:

subscribe(topic, handler){uijet}

modules/pubsub/eventbox.js, line 34

Subscribes a handler to an event of type topic.

Name Type Description
topic string

the event type to register the handler to.

handler function

function to trigger when topic event is published.

See:

unsubscribe(topic, handler){uijet}

modules/pubsub/eventbox.js, line 47

Unsubscribe a handler from a topic, or all handlers of a topic.

If handler is not supplied all handlers of type topic will be removed.

Name Type Description
topic string

topic to unsubscribe from.

handler * optional

identifier of the handler to remove, e.g: the handler function itself.

See: