wait-for: add some delay between each loop

This commit is contained in:
MapleLeaf
2021-12-09 04:09:47 -06:00
parent a7b1221524
commit 9fb58ab471

View File

@@ -3,6 +3,6 @@ import type { MaybePromise } from "./types.js"
export async function waitFor(condition: () => MaybePromise<boolean>) {
while (!(await condition())) {
await setTimeout()
await setTimeout(100)
}
}