Skip to main content

hasPendingRequests

Callable

  • hasPendingRequests(originatingFetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>): boolean

  • Exposes a mechanism that can be used to know if all requests that have been started with a given buildFetch result have completed.

    @example
    import { hasPendingRequests } from '@data-eden/network';
    import { fetch } from './my-app-buildFetch';

    console.log(hasPendingRequests(fetch)) // => false;

    let result = fetch('/some-url');

    console.log(hasPendingRequests(fetch)) // => true;

    await result;

    console.log(hasPendingRequests(fetch)) // => false;

    Parameters

    • originatingFetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

    Returns boolean