Interface DisposableOne

Hierarchy

Properties

Methods

Properties

current?: DisposableType

The current DisposableType.

Methods

  • Invoke the executor function and set the returned DisposableType.

    Do nothing if the DisposableType already exists.

    Returns

    The returned DisposableType.

    Type Parameters

    Parameters

    • executor: (() => T)

      A function that returns a DisposableType.

        • (): T
        • Returns T

    Returns T

  • Invoke the executor function and set the returned DisposableType.

    Do nothing if null | undefined is returned or the returned DisposableType already exists.

    Returns

    The returned DisposableType, or undefined if the executor returns undefined | null.

    Type Parameters

    Parameters

    • executor: (() => undefined | null | void | T)

      A function that returns either a DisposableType or undefined | null.

        • (): undefined | null | void | T
        • Returns undefined | null | void | T

    Returns void | T

  • Invoke the executor function and set the returned DisposableType. Do nothing if undefined | null is returned.

    Do nothing if the DisposableType already exists.

    Returns

    The DisposableType, or undefined if the executor returns undefined | null.

    Type Parameters

    Parameters

    • executor: (() => undefined | null | void | T)

      A function that returns either a DisposableType or undefined | null.

        • (): undefined | null | void | T
        • Returns undefined | null | void | T

    Returns void | T