Wire.js connect facet - multiple receivers of function call

25 views
Skip to first unread message

Tony Hallett

unread,
Feb 5, 2015, 3:32:37 PM2/5/15
to cuj...@googlegroups.com
Hi,

Is there a way to connect multiple receivers to the same function call ?

Thanks

Tony

Brian Cavalier

unread,
Feb 5, 2015, 4:42:49 PM2/5/15
to cuj...@googlegroups.com
Hi Tony,

The connect facet can work in either direction.  In each receiver you could use connect to connect a source component's method to a method on the current receiver.  For example, something like:

{
receiver1: {
create: ...
connect: { 'source.someMethod': 'localMethod' }
},
receiver2: {
create: ...
connect: { 'source.someMethod': 'anotherLocalMethod' }
},
source: {
create: ...
}
}


All of the connecting facets, including AOP can work in either direction like that.  Hope that helps!


Reply all
Reply to author
Forward
0 new messages