npm.io
0.0.4 • Published 12 years ago

biojs-events

Licence
Apache 2
Version
0.0.4
Deps
1
Vulns
0
Weekly
0
Stars
1

event system

This is a convenience wrapper for the Event system.

You can choose any library that supports the choosen syntax.

This wrapper here is for backbone-events-standalone and thus the Backbone event system.

How to use

1. install
npm install biojs-events --save
2. Mix the events capability with your object

After the code of your BioJS component add the events capability by mixing you component object with the events:

require('biojs-events').mixin(my_component);
3. Trigger events

Now in your code you can use the events methods (trigger, off,on,once):

self.trigger('onSomethingChanged', {
 data : "some data to include in your event"
});

Keywords