Skip to content

createAbortable return type incorrect #817

@pxbuffer

Description

@pxbuffer

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

/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions