UNPKG

led-matrix-ts

Version:

Highly customizable led matrix for the browser

18 lines 384 B
export class Event { constructor() { this.handlers = []; } on(handler) { this.handlers.push(handler); } off(handler) { this.handlers = this.handlers.filter(h => h !== handler); } trigger(data) { this.handlers.slice(0).forEach(h => h(data)); } expose() { return this; } } //# sourceMappingURL=event.js.map