Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventBus

Hierarchy

  • EventBus

Index

Constructors

constructor

  • Parameters

    • Optional context: any

    Returns EventBus

Methods

context

  • context(): any
  • context(ctx: any): void
  • Returns any

  • Parameters

    • ctx: any

    Returns void

destroy

  • destroy(): void
  • 销毁自身

    Returns void

fire

  • fire(e: string | Event, args?: Array<any>, that?: any): void
  • Parameters

    • e: string | Event
    • Optional args: Array<any>
    • Optional that: any

    Returns void

isDestroyed

  • isDestroyed(): boolean
  • 是否已销毁

    Returns boolean

off

  • Parameters

    Returns boolean

on

  • on<H>(types: string, handler: H, once?: boolean): boolean
  • Type parameters

    • H

    Parameters

    • types: string
    • handler: H
    • Optional once: boolean

    Returns boolean

original

  • Returns original event listeners of the type.

    Parameters

    • type: string

    Returns EventHandler[]

  • Returns original event listener of the type and euid.

    Parameters

    • type: string
    • euid: number

      Wrapped listener's uuid

    Returns EventHandler

types

  • types(): string[]
  • Returns string[]