Function firstValueFromSubscribableOrDefault

  • Asynchronously get the first value emitted by the Subscribable. If no value is emitted undefined will be returned

    Type Parameters

    • T

    Parameters

    • subject: Observable<T> | Subscribable<T>

      The subscribable

    Returns Promise<T | undefined>

  • Asynchronously get the first value emitted by the Subscribable. If no value is emitted or the timout is reached, the default value will be returned instead

    Type Parameters

    • T
    • TDefault

    Parameters

    • subject: Observable<T> | Subscribable<T>

      The subscribable

    • defaultValue: TDefault

      The default value to use

    • Optionaltimeout: number

      The timeout before the default value is used

    Returns Promise<T | TDefault>