UNPKG

@gravity-ui/data-source

Version:
10 lines (9 loc) 415 B
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"];