Skip to content

Instantly share code, notes, and snippets.

@bpalij
bpalij / AsyncIntervalTimer.ts
Last active August 22, 2022 15:25
AsyncIntervalTimer
const minDelay = 1000; // it will be possible to control it finishing with setInterval 0
export class AsyncIntervalTimer {
private realDelay: number;
// eslint-disable-next-line @typescript-eslint/ban-types
private fn: Function;
private args: Array<any>;
const defaultSnapshot = {
token: '',
myInnerInfo: { login: '', type: '' },
myDisplayInfo: { login: '', type: '' },
loginInfo: { login: '', type: '' },
loginList: [],
loading: false,
logined: false,
}