Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A hierarchical pub/sub event manager with namespace wildcard support.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
src-test
src
.jshintrc
README.md
package.json
testacular.conf.js

README.md

ScopedEvent

A hierarchical pub/sub event manager with namespace wildcard support.

Usage

var eventManager = scopedEvent();

eventManager.bind('evtype:this.that.other', function(){
  console.log('Handler for evtype:this.that.other fires, is passed:', arguments);
});

eventManager.bind('evtype:this.that.*', function(){
  console.log('Handler for evtype:this.that.* fires, is passed:', arguments);
});

eventManager.bind('evtype:this.*', function(){
  console.log('Handler for evtype:this.* fires, is passed:', arguments);
});

eventManager.bind('evtype:*', function(){
  console.log('Handler for evtype:* fires, is passed:', arguments);
});

eventManager.bind('*', function(){
  console.log('Handler for * fires, is passed:', arguments);
});

eventManager.trigger('evtype:this.that.other', {
  someData: 'xxxx'
});

Run Tests

$ testacular start
Something went wrong with that request. Please try again.