@gravity-ui/data-source
Version:
A wrapper around data fetching
10 lines (9 loc) • 415 B
TypeScript
import type { AnyDataSource } from '../types/DataSource';
export interface Cancellable {
cancel: () => void;
}
export declare const isCancellable: (value: unknown) => value is Cancellable;
export declare const isAbortable: (value: unknown) => value is {
signal: AbortSignal;
};
export declare const withCancellation: <TDataSource extends AnyDataSource>(fetch: TDataSource["fetch"]) => TDataSource["fetch"];