friday-ai / friday

Friday is your open-source home automation assistant.
MIT License
1 stars 1 forks source link

Convert Event class's methods to static methods #54

Closed MathieuAndrade closed 2 years ago

MathieuAndrade commented 2 years ago

Target code

export default class Event {
  public static emitter = new EventEmitter();

  static emit(event: EventsType, ...args: any) {
    this.emitter.emit(event, ...args);
  }

  static on(event: EventsType, cb: (...args: any[]) => void) {
    this.emitter.on(event, cb);
  }
}