function takeEarly
takeEarly(
url: string,
token: string | undefined
): Promise<Response> | undefined

Returns the response of the request started for url, once and to the session it was sent as, or undefined when there is none, or none recent enough: the caller then sends its own. authFetch asks it for every GET.

Parameters

url: string
token: string | undefined

Return Type

Promise<Response> | undefined

Usage

import { takeEarly } from "src/utils/shared/earlyFetch.ts";