Get the mediator instance for a given view instance or class
Hi,
The current MediatorMap implementation is not exposing the MediatorFactory. Is there a specific reason why we can't access the API? Specifically I need some way of accessing mediator instances.
Thanks,
Matan
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Shaun Smith on 03 Jul, 2013 12:42 PM
Hi Matan,
Sorry for the delay - I've been a little under the weather. I'll take a look and get back to you asap.
Support Staff 2 Posted by Shaun Smith on 03 Jul, 2013 12:54 PM
Yup. The MediatorFactory is a private class - to keep the library maintainable going forward we have to reduce the API footprint that we officially support. The MediatorFactory and MediatorManager classes are internal implementation details that may be wildly changed or even completely dropped in the future.
I think we need to find a solution to your actual need (getting the list of mediators for a given view) without exposing framework internals.
As a matter of interest, what is your use case for this requirement?
Support Staff 3 Posted by Shaun Smith on 03 Jul, 2013 01:01 PM
I've opened a new issue for this: https://github.com/robotlegs/robotlegs-framework/issues/147
4 Posted by Matan Uberstein on 03 Jul, 2013 01:15 PM
Hi Shaun,
Sorry to hear you're feeling under the weather, hope you feel better soon. :)
EDIT: Ok, you've opened the ticket, below is my reasoning anyway. :)
I've written a RL2 extension called StateMap which piggy backs off the MediatorMap. The resulting api looks like this:
stateMap.map(MainScreen).toMediator(MainScreenMediator).withStates(SecId.MAIN_SCREEN);
I'm using AS3Navigator as my internal state handler. In order to map the state, I need to provide an instance of a "INavigationResponder". Which in this case will always be a Mediator instance.
Luckily I've got a work-a-round by using my custom implementation of
StarlingMediatorMap
which simply exposes the factory.The resulting "dirty" code with my
StateMapping
looks like this:Thanks,
Matan
Ondina D.F. closed this discussion on 18 Jul, 2013 01:31 PM.