Options
All
  • Public
  • Public/Protected
  • All
Menu

Event emitter that guarantees sequential execution of handlers. Each handler may return a Promise.

see

Node EventEmitter.

Hierarchy

  • SequentialEvent

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Protected __events

__events: IEventsHash

Events hash attached to this SequentialEvent instance

Methods

emit

  • emit(event: string, ...args: any[]): Promise<any>
  • Triggers each corresponding handlers in sequence.

    author

    Gerkin

    Parameters

    • event: string

      Name of the event to trigger

    • Rest ...args: any[]

      Arguments to pass to each handler. Note that those arguments will be appended with previous handler resolution value, if any.

    Returns Promise<any>

has

  • has(event: string): boolean
  • Check if this instance has listeners for the provided event. Alias for hasEvent

    author

    Gerkin

    Parameters

    • event: string

      Name of the event to check

    Returns boolean

hasEvent

  • hasEvent(event: string): boolean
  • Check if this instance has listeners for the provided event

    author

    Gerkin

    Parameters

    • event: string

      Name of the event to check

    Returns boolean

off

  • Remove one, many or all event handlers on some events.

    author

    Gerkin

    Parameters

    • events: string

      String containing event names to unbind. You may indicate several events at once by separating with spaces

    • Optional callback: IEventHandler | IEventHandler[]

      Function or array of functions to unbind on specified events

    Returns this

  • Remove event handlers on several events at once.

    author

    Gerkin

    Parameters

    • events: IEventHash

      Object with keys as event names containing a handler or an array of handlers to remove.

    Returns this

  • Remove all events handlers

    author

    Gerkin

    Parameters

    • all: true

      Pass true to delete all handlers

    Returns this

on

  • Add one or many event handlers.

    author

    Gerkin

    Parameters

    • events: string

      String containing event names to bind. You may indicate several events at once by separating with spaces

    • callback: IEventHandler | IEventHandler[]

      Function or array of functions to bind on specified events

    Returns this

  • Add event handlers on several events at once.

    author

    Gerkin

    Parameters

    • events: IEventHash

      Object with keys as event names containing a handler or an array of handlers to add.

    Returns this

once

  • Add one or many event handlers. These listeners will be executed once, then are removed

    author

    Gerkin

    Parameters

    • events: string

      String containing event names to bind. You may indicate several events at once by separating with spaces

    • callback: IEventHandler | IEventHandler[]

      Function or array of functions to bind on specified events

    Returns this

  • Add event handlers on several events at once. These listeners will be executed once, then are removed

    author

    Gerkin

    Parameters

    • events: IEventHash

      Object with keys as event names containing a handler or an array of handlers to add.

    Returns this

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc