Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

dispatch

Global event manager, pub/sub implementation

Usage

dispatch.on('newEvent', function(data){
  alert(data.message);
});

dispatch.trigger('newEvent', { message: 'Thug Life' });

dispatch.off('newEvent');

Demo

Check it out

Methods

dispatch.on(Event Name, Callback Method)

Creates new global event binding

Params:

  • string Event Name

  • function Callback Method

dispatch.off(Event Name)

Removes global event binding

Params:

  • string Event Name

dispatch.trigger(Event Name,Data Object)

Triggers global event

Params:

  • string Event Name

  • object Data Object

About

Global events manager

Resources

Stars

Watchers

Forks

Packages

No packages published