Global event manager, pub/sub implementation
dispatch.on('newEvent', function(data){
alert(data.message);
});
dispatch.trigger('newEvent', { message: 'Thug Life' });
dispatch.off('newEvent');
Creates new global event binding
-
string Event Name
-
function Callback Method
Removes global event binding
- string Event Name
Triggers global event
-
string Event Name
-
object Data Object