2018-04-02 07:34:16 +02:00

3 lines
140 B
TypeScript

export function delay<T>(millis: number, value?: T): Promise<T> {
return new Promise(resolve => setTimeout(() => resolve(value), millis))
}