@dotmh/tick
Version:
A utility library for making polling loops
17 lines (16 loc) • 420 B
TypeScript
export type Condition = () => boolean;
export type Callback = () => void;
export declare class Tick {
private _tick;
private _time;
private _timeOutId?;
private _condition;
get time(): string;
get mTime(): number | null;
get lTime(): string;
every(timeString: string): Tick;
when(condition: Condition): Tick;
start(callback: Callback): void;
stop(): void;
private tick;
}