Wraps a synchronous function to return a cancellable promise. Converts any function into an async operation.
The return type of the function
The synchronous function to wrap
Optional
Cancellable configuration options
A function that returns a cancellable handle
const syncFn = (x: number) => x * 2;const asyncFn = asyncify(syncFn);const result = await asyncFn(5); // 10 Copy
const syncFn = (x: number) => x * 2;const asyncFn = asyncify(syncFn);const result = await asyncFn(5); // 10
Wraps a synchronous function to return a cancellable promise. Converts any function into an async operation.