2.0.1 • Published 8 years ago

ms-eventjs v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

eventjs

eventjs will help you to manage you custom javascript events.

Setup

npm

This package is published through npm under the name ms-eventjs

npm install ms-eventjs
bower

This package is published through bower under the name ms-eventjs

bower install ms-eventjs

Once installed, simply add dist/eventjs.min.js file into your html file.

Usage

#####Create event:

$event.eventbus.Create('eventName');

#####Subscribe event:

$event.eventbus.Subscribe('eventName', Namespace.someFunction);

#####Publish event:

// excecute all handlers in sync 
$event.eventbus.Publish('eventName');

// excecute all handlers in async 
$event.eventbus.Publish('eventName', true);

#####UnSubscribe event:

$event.eventbus.UnSubscribe('eventName', Namespace.someFunction);

Examples

You can also checkout sample code in Examples folder.

##TODO 1. Unit testing http://jasmine.github.io/2.4/introduction.html 2. travis-ci integration 3. Integrate document.events

Watcher

you can subscribe to the changes of any object. E.g.

var obj = {fName: 'Manoj', lName: 'Shevate'};
$event.watch(obj, function(c){
	// This function will be called whenever any changes made to the object "obj"
});
2.0.1

8 years ago

2.0.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago