devowl-wp
    Preparing search index...
    • Add a request to the batch request pool and execute it accordingly. Please note, that only non-GET requests and routes with enabled allow_batch and non-multipart request are suitable for the batch requests in WordPress.

      Type Parameters

      • TResponse

      Parameters

      • request: BatchRequestObject
      • options: {
            restNamespace: string;
            restNonce?: string;
            restPathObfuscateOffset?: string;
            restQuery?: object;
            restRecreateNonceEndpoint?: string;
            restRoot: string;
        } & {
            onQueueItemFinished?: (state: boolean) => void;
            signal?: AbortSignal;
            waitForPromise?: Promise<void>;
        }
        • restNamespace: string
        • OptionalrestNonce?: string
        • OptionalrestPathObfuscateOffset?: string
        • OptionalrestQuery?: object
        • OptionalrestRecreateNonceEndpoint?: string
        • restRoot: string
        • OptionalonQueueItemFinished?: (state: boolean) => void

          This method gets called when a queue item got finished (resolved or rejected). It does not return the current value for the request, for this you need to use the result of the original commonRequest call.

          This is called before the commonRequest Promise gets resolved and ignores the passed waitForPromise.

        • Optionalsignal?: AbortSignal
        • OptionalwaitForPromise?: Promise<void>

          Wait for this promise to be resolved before resolving the commonRequest Promise. This is useful if you use a huge list in your e.g. React component and you want to delay UI changes.

      Returns Promise<TResponse>