on(type: string, handler: (event?: any) => void) {
    return this.emitter.on(type, handler);
  }