import { EventEmitter } from "events"; import { CommunicationEvents, ICommunicationInterface } from "../dispatcher/nopeDispatcher"; /** * A Communication Layer for the Dispatchers. * Here, only a Events are used. * * @export * @class EventLayer * @implements {ICommunicationInterface} */ export class EventLayer implements ICommunicationInterface { protected _emitter = new EventEmitter(); on(event: CommunicationEvents, cb: (...args: any[]) => void) { this._emitter.on(event, cb); } send(data: any): void { this._emitter.emit('event', data) } }