mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 08:20:08 +00:00
8 lines
169 B
TypeScript
8 lines
169 B
TypeScript
export function delayUntil(maxMs: number, isReady: () => boolean) {
|
|
const maxed = Date.now() + maxMs;
|
|
|
|
while (Date.now() < maxed) {
|
|
if (isReady()) return;
|
|
}
|
|
}
|