Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventEmitter

EE

export

Hierarchy

Index

Constructors

Properties

_listeners: Map<string, TinoeEventListener[]>
parent: EventEmitter

Methods

  • addEventListener(type: string, handler: ((data: any) => any), once?: boolean): void
  • 注册handler

    memberof

    EventEmitter

    Parameters

    • type: string
    • handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • dispatch(type: string, data?: any): void
  • 派发事件

    memberof

    EventEmitter

    Parameters

    • type: string
    • Optional data: any

    Returns void

  • off(type?: string, handler?: ((data: any) => any)): void
  • 注销事件

    memberof

    EventEmitter

    Parameters

    • Optional type: string
    • Optional handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    Returns void

    {void}

  • on(type: string, handler: ((data: any) => any), once?: boolean): void
  • 注册handler

    memberof

    EventEmitter

    Parameters

    • type: string
    • handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • removeEventListener(type?: string, handler?: ((data: any) => any), once?: boolean): void
  • 注销handler

    memberof

    EventEmitter

    Parameters

    • Optional type: string
    • Optional handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

Generated using TypeDoc