tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/300-correct-registering-listeners-in-mediatorRobotlegs: Discussion 2013-04-28T10:25:41Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/31885392010-10-01T13:09:48Z2010-10-01T13:09:48ZCorrect registering listeners in mediator<div><p>Hi Viktor,</p>
<p>I would suggest using the Event Map - it stores a reference to each listener and automatically removes all listeners when the mediator is removed. It also provides an option for runtime event type checking. Using it will not affect application performance.</p>
<p>If you decide not to use it, you must make sure to manually remove any listeners you have set up in the Mediator's onRemove() hook.</p>
<p>Hope that helps!</p></div>Shaun Smith