mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1export async function wait<T>(delay: number, fn: T): Promise<Awaited<T>> { 2 return await Promise.all([fn, new Promise(y => setTimeout(y, delay))]).then( 3 arr => arr[0], 4 ) 5}