4 lines
149 B
TypeScript
Raw Normal View History

2019-11-18 02:04:13 +00:00
export default function delay<T>(millis: number, value?: T): Promise<T> {
2018-04-02 05:34:16 +00:00
return new Promise(resolve => setTimeout(() => resolve(value), millis))
2019-11-17 09:44:30 +00:00
}