2019-11-18 11:04:13 +09:00

4 lines
149 B
TypeScript

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