activeRequests
An object for managing the active requests.
import { activeRequests } from 'bestfetch';
activeRequests
has two methods:
isRequestInFlight
A method you can call to determine if a request is in flight for a given requestKey
.
requestKey
: The requestKey
to check.A boolean
representing whether or not a request is in flight for the specified requestKey
.
activeRequests.isRequestInFlight('my-request-key');
clear
Removes tracking on all in-flight requests. In-flight requests are not cancelled: calling this method only ensures that subsequent identical requests are not deduped.
This method does not accept any arguments.
This method does not return anything.
activeRequests.clear();