Simple specialization of Signal for the common case of a nullary handler signature.

Hierarchy

  • Signal<(() => void)>
    • NullarySignal

Constructors

Properties

Methods

Constructors

Properties

count: number = 0

Count of number of times this signal has been dispatched. This is incremented each time dispatch is called prior to invoking the handlers.

dispatch: (() => void)

Invokes each handler function with the same parameters (including this) with which it is called. Handlers are invoked in the order in which they were added.

Type declaration

    • (): void
    • Invokes each handler function with the same parameters (including this) with which it is called. Handlers are invoked in the order in which they were added.

      Returns void

Methods

  • Add a handler function. If dispatch is currently be called, then the new handler will be called before dispatch returns.

    Returns

    A function that unregisters the handler.

    Parameters

    • handler: (() => void)

      The handler function to add.

        • (): void
        • Returns void

    Returns (() => boolean)

      • (): boolean
      • Add a handler function. If dispatch is currently be called, then the new handler will be called before dispatch returns.

        Returns

        A function that unregisters the handler.

        Returns boolean

  • Remove a handler function. If dispatch is currently be called and the new handler has not yet been called, then it will not be called.

    Returns

    true if the handler was present, false otherwise.

    Parameters

    • handler: (() => void)

      Handler to remove.

        • (): void
        • Returns void

    Returns boolean

Generated using TypeDoc