@uploadcare/upload-client
    Preparing search index...

    Variable pollConst

    poll: <T>(
        { check, interval, timeout, signal }: {
            check: PollCheckFunction<T>;
            interval?: number;
            signal?: AbortSignal;
            timeout?: number;
        },
    ) => Promise<T>

    Call check until it returns something truthy, waiting interval milliseconds between attempts, and resolve with that value.

    Rejects with a CancelError when signal aborts or timeout elapses, whichever happens first. Either one ends the loop for good: no further check runs, and the result of one already in flight is discarded.

    A check in flight is still awaited before that rejection surfaces, so pass signal on to whatever the attempt does if cancellation should be prompt.

    Type declaration

      • <T>(
            { check, interval, timeout, signal }: {
                check: PollCheckFunction<T>;
                interval?: number;
                signal?: AbortSignal;
                timeout?: number;
            },
        ): Promise<T>
      • Type Parameters

        • T

        Parameters

        • { check, interval, timeout, signal }: {
              check: PollCheckFunction<T>;
              interval?: number;
              signal?: AbortSignal;
              timeout?: number;
          }

        Returns Promise<T>