Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IStream<T, U>

An object that is both a signal and an async iterable.

Type parameters

  • T

  • U

Hierarchy

  • ISignal<T, U>
  • AsyncIterable<U>
    • IStream

Index

Methods

[Symbol.asyncIterator]

  • [Symbol.asyncIterator](): AsyncIterator<U, any, undefined>
  • Returns AsyncIterator<U, any, undefined>

Optional block

  • block(fn: () => void): void
  • Block the signal during the execution of a callback.

    Notes

    The callback function must be synchronous.

    deprecated

    This feature will be removed in Lumino 2.

    Parameters

    • fn: () => void

      The callback during which the signal is blocked

        • (): void
        • Returns void

    Returns void

connect

  • connect(slot: Slot<T, U>, thisArg?: any): boolean
  • Connect a slot to the signal.

    Parameters

    • slot: Slot<T, U>

      The slot to invoke when the signal is emitted.

    • Optional thisArg: any

      The this context for the slot. If provided, this must be a non-primitive object.

    Returns boolean

    true if the connection succeeds, false otherwise.

    Notes

    Slots are invoked in the order in which they are connected.

    Signal connections are unique. If a connection already exists for the given slot and thisArg, this method returns false.

    A newly connected slot will not be invoked until the next time the signal is emitted, even if the slot is connected while the signal is dispatching.

disconnect

  • disconnect(slot: Slot<T, U>, thisArg?: any): boolean
  • Disconnect a slot from the signal.

    Parameters

    • slot: Slot<T, U>

      The slot to disconnect from the signal.

    • Optional thisArg: any

      The this context for the slot. If provided, this must be a non-primitive object.

    Returns boolean

    true if the connection is removed, false otherwise.

    Notes

    If no connection exists for the given slot and thisArg, this method returns false.

    A disconnected slot will no longer be invoked, even if the slot is disconnected while the signal is dispatching.

Generated using TypeDoc