Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

8. Connecting views with Mediators > Why can’t Mediators be injected into other...

Why can’t Mediators be injected into other objects?

In Robotlegs 1.6 we’ve fully removed mediator mappings on the injector, so it shouldn’t be possible to inject a mediator into another class unless you were to set up the injection manually (if you want to do this then come talk to us about it on the forum, there are ways but they’re usually not the best solution available.) But in earlier versions of Robotlegs it was possible to inject mediators as a side-effect of how the mediator map did its job.

The number one reason not to inject mediators is that your mediator will then persist even after the view has left the stage, and wham!—suddenly you’ve got memory leaks and unexpected behaviors all over the place.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial