@bigmi/core
Version:
TypeScript library for Bitcoin apps.
13 lines (12 loc) • 421 B
TypeScript
type PollOptions<T> = {
emitOnBegin?: boolean | undefined;
initialWaitTime?: ((data: T | undefined) => Promise<number>) | undefined;
interval: number;
};
/**
* @description Polls a function at a specified interval.
*/
export declare function poll<T>(fn: ({ unpoll }: {
unpoll: () => void;
}) => Promise<T | undefined>, { emitOnBegin, initialWaitTime, interval }: PollOptions<T>): () => void;
export {};