Installation
- Node.js, browserify
npm install multi-event --save
- Require.js
require(["multi-event"], ...
Examples
var MultiEvent = ; // require itvar myEvents = ; // Implement listenervar { console;}; // Register callBack event listenermyEvents; myEvents;// shows 'this will be passed to the callback' in console
Multiple events Examples
var MultiEvent = ; // require itvar myEvents = ;var myEventsSubSet = ; myEvents; // Implement listenervar { console;};var { console;}; var { console;}; var { console;}; // Register callBack event listenermyEvents ; // this callBack is trigged to all 'event' sub-events myEventsSubSet; myEvents;// the following will be displayed on the console// callBack1 says : this string will be logged twice// callBack says : this string will be logged twicemyEvents;// the following will be displayed on the console// callBack2 says : this string will be logged twice// callBack says : this string will be logged twice myEvents;// the following will be displayed on the console// pipeCallBack says : this will be passed to the other emitter also (from myEventsSubSet)
EcmaScript6
This module is writen in ES6, you can find the in src/multi-event-es6.js
For building your modification run npm run build
, the files multi-event.js
and multi-event.min.js
are created in dist
folder
Build and test
- Build
npm run build
- Test
npm run test
- Watch changes and run tests and buil
npm run watch