Creates and handles an AbortSignal with automated cleanup
const [signal, abort, filterAbortError] = createAbortable();const fetcher = (url) => fetch(url, { signal: signal() }) .catch(filterAbortError); // filters abort errors Copy
const [signal, abort, filterAbortError] = createAbortable();const fetcher = (url) => fetch(url, { signal: signal() }) .catch(filterAbortError); // filters abort errors
Returns an accessor for the signal and the abort callback.
Options are optional and include:
timeout
noAutoAbort
Creates and handles an AbortSignal with automated cleanup
Returns an accessor for the signal and the abort callback.
Options are optional and include:
timeout
: time in Milliseconds after which the fetcher aborts automaticallynoAutoAbort
: can be set to true to make a new source not automatically abort a previous request