Dispatching signals from the model and having mediators listen to them.
Support Staff2 Posted by Stray on 17 Jul, 2011 08:32 AM
It all depends what you're trying to achieve - but certainly
it's worth knowing how to do it so you can choose the right
approach for your app.
If your signal is a property of the model you'll need to map it
for injection in your context or a command. A command is easier in
some ways as injecting the model into the command will cause it to
This is great, thanks a lot for the explanation! I'll give these a try and
see how it works.
I wasn't sure if I should be sticking to one method only (signals or events,
and not mixing), it's more clear now and I'd also prefer to choose what's
most appropriate for the situation. Knowing how to do both now is awesome.
I'll let you know if I have any problems.
On Sun, Jul 17, 2011 at 1:32 AM, Stray <
[email blocked]> wrote:
I understand how to map the signal for injection in my context; however I
just tried to do the same thing in a command but I'm getting an error
(Injector is missing a rule to handle injection into property
"dataReadySignal" of object "[object FlickrAuthorsMediator]".) I must be
missing something when trying to map the injector by using a command but
can't seem to figure out where the problem is.
In my MainContext class I'm injecting other classes and mapping mediators as
well as mapping a command to the STARTUP_COMPLETE event. In my command
that's mapped to the STARTUP_COMPLETE event I'm injecting my model and have
one line in my execute function: injector.mapValue(DataReadySignal,
Could the problem be order of execution? The mediator that uses the signal
is mapped before the signal is injected? My code is on github if it helps to
see what I'm trying to achieve: https://github.com/ryac/rl-flickr