switchyard
    Preparing search index...

    Function waitFor

    • Resolves with the machine once predicate holds (checked now, then after every change). With timeout, rejects if it has not held by then, on clock (default: the configured one).

      Type Parameters

      Parameters

      • machine: M
      • predicate: (machine: M) => boolean
      • __namedParameters: { clock?: Clock; timeout?: number } = {}

      Returns Promise<M>