Observing controllers for particular configuration changes

4 views
Skip to first unread message

Steven Luscher

unread,
Jul 20, 2011, 4:25:22 PM7/20/11
to Blast Mojo
Hi everyone,

It's true, we can observe a controller's configuration for changes,
and fire commands:

this.addObserver(this.getConfig('params').mode, 'onChange',
'DoSomething');

Does anyone have a really elegant way of firing a particular command
depending on what the configuration has changed to?

this.addObserver(this.getConfig('params').mode, 'onChange',
'DoSomething'); // ONLY when mode changes to 'on'
this.addObserver(this.getConfig('params').mode, 'onChange',
'DoSomethingElse'); // ONLY when mode changes to 'off'

Cheers,
Steve…
Reply all
Reply to author
Forward
0 new messages