Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "hs/wait/index"

Index

Type aliases

Functions

Type aliases

Matcher

Matcher: V | function

Matcher is either the primitive value (e.g. 123 / 'abc') or a function that returns true when provided with an appropriate argument.

Functions

matchWaiter

  • matchWaiter<T, V>(matcher: Matcher<T, V>, value: T): boolean

notUndefined

  • notUndefined(value: any): boolean

wait

  • watch takes a hyper-value and wait until it matches to a matcher. When it match it resolves returned promise. If there are only 2 arguments provided it waits until hyper-value is not undefined

    Type parameters

    • V

      type of hyper-value

    Parameters

    • hs: HyperScope

      HyperScope instance

    • hv: HyperValue<V | undefined>

      hyper-value to be observed

    Returns Promise<HyperValue<V>>

    a promise to be resolved when matcher matches

  • watch takes a hyper-value and wait until it matches to a matcher. When it match it resolves returned promise. If there are only 2 arguments provided it waits until hyper-value is not undefined

    Type parameters

    • V: T

      narrowed type of hyper-value; e.g. wait(hs, hv, 123 as 123) will be resolved with HyperValue<123> but not with HyperValue<number>

    • T

      type of hyper-value

    Parameters

    • hs: HyperScope

      HyperScope instance

    • hv: HyperValue<T>

      hyper-value to be observed

    • resolveOn: Matcher<T, V>

      matcher that triggers resolve of the Promise

    • Optional rejectOn: Matcher<T, V>

      matcher that triggers reject of the Promise

    Returns Promise<HyperValue<V>>

    a promise to be resolved when matcher matches

Generated using TypeDoc