High performance event system mainly foucs on game.
npm install event-sys
used as class
import { EventEmitter } from 'event-sys';
let e = new EventEmitter();
e.on('foobar', (foo, bar) => {
// ouput: 'foo', 'bar'
console.log(`${foo}, ${bar}`);
});
mixin with Node
import { EventEmitter } from 'event-sys';
import { Node } from 'scene-graph';
class EventNode extends Node {
constructor() {
this.__initEventEmitter();
}
}
EventEmitter.mixin(EventNode);
TODO
MIT © 2017 Johnny Wu