ms-eventjs

JS library to create custom events

Showing:

Popularity

Downloads/wk

3

GitHub Stars

0

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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"
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100