Pubsub hub.
See the dojo/topic reference documentation for more information.
topic.subscribe("some/topic", function(event){
... do something with event
});
topic.publish("some/topic", {name:"some event", ...});
publish
(topic,event)
Defined by dojo/topic
Publishes a message to a topic on the pub/sub hub. All arguments after the first will be passed to the subscribers, so any number of arguments can be provided (not just event).
Parameter | Type | Description |
---|---|---|
topic | String |
The name of the topic to publish to |
event | Object |
An event to distribute to the topic listeners |
Returns: undefined
subscribe
(topic,listener)
Defined by dojo/topic
Subscribes to a topic on the pub/sub hub
Parameter | Type | Description |
---|---|---|
topic | String |
The topic to subscribe to |
listener | Function |
A function to call when a message is published to the given topic |
Returns: undefined
© 2005–2017 JS Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/topic.html