-
Notifications
You must be signed in to change notification settings - Fork 143
Description
Describe the bug
export declare function makeAbortable(options?: AbortableOptions): [
signal: () => AbortSignal,
abort: (reason?: string) => void,
filterAbortError: (err: any) => void
];
/**
* **Creates and handles an AbortSignal with automated cleanup**
* ```ts
* 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`: time in Milliseconds after which the fetcher aborts automatically
* - `noAutoAbort`: can be set to true to make a new source not automatically abort a previous request
*/
// incorrect return type
export declare function createAbortable(options?: AbortableOptions): ((reason?: string) => void)[];createAbortable() should return the same type as makeAbortable
Minimal Reproduction Link
/