Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 43 lines (27 sloc) 0.935 kB
fcc4fff @phiggins42 monster commit from moinconverter, which is always done prior to the …
phiggins42 authored
1 .. _dojo/connectPublisher:
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
2
b0d71a2 @phiggins42 headings
phiggins42 authored
3 =====================
9dd52dc @phiggins42 mondo whitespace change
phiggins42 authored
4 dojo.connectPublisher
5 =====================
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
6
2db6e6b @wkeese Overhaul event documentation.
wkeese authored
7 Deprecated.
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
8
2db6e6b @wkeese Overhaul event documentation.
wkeese authored
9 dojo.connectPublisher() was an automation of this common form:
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
10
c49c87d @phiggins42 normalization
phiggins42 authored
11 .. js ::
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
12
9dd52dc @phiggins42 mondo whitespace change
phiggins42 authored
13 dojo.connect(myObject, "myEvent", function(){
14 dojo.publish("/some/topic/name", arguments);
15 });
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
16
2db6e6b @wkeese Overhaul event documentation.
wkeese authored
17 Which became:
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
18
2db6e6b @wkeese Overhaul event documentation.
wkeese authored
19 .. code-block :: javascript
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
20
9dd52dc @phiggins42 mondo whitespace change
phiggins42 authored
21 dojo.connectPublisher("/some/topic/name", myObject, "myEvent");
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
22
2db6e6b @wkeese Overhaul event documentation.
wkeese authored
23 But going forward users should use the following for connecting to DOM events:
d608cc5 @phiggins42 \r\n -> \n conversion.
phiggins42 authored
24
c49c87d @phiggins42 normalization
phiggins42 authored
25 .. js ::
2db6e6b @wkeese Overhaul event documentation.
wkeese authored
26
27 require(["dojo/on", "dojo/topic"], function(on, topic){
28 on(myNode, "click", function(){
29 topic.publish("/some/topic/name", arg1, arg2, arg3);
30 });
31 });
32
33 Or this for after-advice on arbitrary methods of arbitrary objects:
f57344b @wkeese More cleanup around .. js, .. css, and unneeded <script>/<style> tags
wkeese authored
34
35 .. js ::
2db6e6b @wkeese Overhaul event documentation.
wkeese authored
36
37 require(["dojo/aspect", "dojo/topic"], function(aspect, topic){
38 aspect.after(myObj, "myFunc", function(){
39 topic.publish("/some/topic/name", arg1, arg2, arg3);
40 });
41 });
42
Something went wrong with that request. Please try again.