代码拉取完成,页面将自动刷新
define(["./Evented"], function(Evented){
// module:
// dojo/topic
var hub = new Evented;
return {
// summary:
// Pubsub hub.
// example:
// | topic.subscribe("some/topic", function(event){
// | ... do something with event
// | });
// | topic.publish("some/topic", {name:"some event", ...});
publish: function(topic, event){
// summary:
// 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).
// topic: String
// The name of the topic to publish to
// event: Object
// An event to distribute to the topic listeners
return hub.emit.apply(hub, arguments);
},
subscribe: function(topic, listener){
// summary:
// Subscribes to a topic on the pub/sub hub
// topic: String
// The topic to subscribe to
// listener: Function
// A function to call when a message is published to the given topic
return hub.on.apply(hub, arguments);
}
};
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。