oelmekki/darwinjs-rails — pull request #5 by oelmekki (2013-12-12 11:41:25+00:00)
Title: ADD global events

Global events can be added that way :

Darwin.on( 'my_event_call', callback )

And can be triggered :

Darwin.trigger( 'my_event_call' )

This is integrated to Darwin.Controller, so you can use it in event
definition :

'Answer to global': { el: 'darwin', type: 'my_event_call' }

Now, in any other module, just trigger the event on darwin :

Darwin.trigger( 'my_event_call' )

This allows for modules to communicate without violating law of demeter
and selector centralization.