UNPKG

interruptor

Version:

Run a function with the possibility to interrupt it from another thread

6 lines (5 loc) 216 B
export type InterruptHandle = { __id: number; }; export declare function runInterruptible<Ret>(fn: (handle: InterruptHandle) => Ret): Ret | void; export declare function interrupt(handle: InterruptHandle): void;