/event-sys

High performance event system mainly for game development

Primary LanguageJavaScriptMIT LicenseMIT

event-sys

High performance event system mainly foucs on game.

Install

npm install event-sys

Usage

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

Documentation

TODO

License

MIT © 2017 Johnny Wu