Amazon Vinyl
    Preparing search index...

    Function poll

    • Repeatedly evaluates predicate until it returns true or the timeout elapses, resolving to the predicate's final value. Useful for waiting on asynchronous state to settle without wiring up an event subscription.

      Parameters

      • predicate: () => boolean

        Evaluated immediately and then every pollInterval seconds. Polling stops as soon as it returns true.

      • options: PollOptions = {}

        Optional PollOptions. With no timeout, polling continues indefinitely until the predicate is true or abort fires.

      Returns Promise<boolean>

      true if the predicate became true within the timeout, otherwise false.