tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/557-problems-picking-up-events-using-the-modular-shared-event-dispatcherRobotlegs: Discussion 2018-10-18T16:35:39Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/153916662012-04-19T11:48:37Z2012-04-19T11:48:37ZProblems picking up events using the modular shared event dispatcher<div><p>Ok guys, after some pair programming the problem has been
solved. It turns out that to dispatch onto the module shared event
dispatcher, the component that everything hinges off must implement
IModule.</p>
<p>Now I know that this is very clear in Joel Hooks examples:
<a href=
"http://joelhooks.com/2010/05/02/modular-robotlegs/">http://joelhooks.com/2010/05/02/modular-robotlegs/</a></p>
<p>But the component I wanted to communicate with was just a
"wrapper" for my modules, and didn't technically need to be a
module itself. I had been using a simple canvas to load modules
into. As soon as I made that component implement IModule, and
extend Module, everything wired together as expected.</p>
<p>It would be interesting to know if there is a way of picking up
events between contexts without having to do this?</p></div>jeremy.brookstag:robotlegs.tenderapp.com,2009-10-18:Comment/153916662012-04-19T11:59:06Z2012-04-19T11:59:06ZProblems picking up events using the modular shared event dispatcher<div><p>Hi Jeremy,</p>
<p>I'm glad you found the answer - 2 brains always best for this
kind of thing, I find.</p>
<p>If you take a look under the hood at the code in the original
Modular extensions - on my fork - you'll find that wiring a shared
dispatcher up is really easy. If you don't want to share injections
between modules then that's actually all you need to do.</p>
<p><a href=
"https://github.com/Stray/robotlegs-utilities-Modular">https://github.com/Stray/robotlegs-utilities-Modular</a></p>
<p>hth,</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/153916662012-04-19T12:05:06Z2012-04-19T12:05:06ZProblems picking up events using the modular shared event dispatcher<div><p>Thanks for the info Stray, I'll take a look.</p></div>jeremy.brooks