dojo.connectPublisher¶
Project owner: | Alex Russell |
---|---|
since: | V0.9 |
Contents
Ensure that every time an event is called, a message is published on the topic.
Introduction¶
dojo.connectPublisher is an automation of this common form:
[ Dojo 1.7 AMD ]
require(["dojo/_base/connect"], function(connect){
connect.connect(myObject, "myEvent", function(){
connect.publish("/some/topic/name", arguments);
});
});
Which becomes:
require("dojo/_base/connect", function(connect){
connect.connectPublisher("/some/topic/name", myObject, "myEvent");
});
[ Dojo < 1.7 ]
dojo.connect(myObject, "myEvent", function(){
dojo.publish("/some/topic/name", arguments);
});
Which becomes:
dojo.connectPublisher("/some/topic/name", myObject, "myEvent");