You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 21, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: src/utils/index.ts
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -488,11 +488,14 @@ export async function sleep(ms: number = 0) {
488
488
})
489
489
}
490
490
491
+
// condition could as well return any instead of boolean, could be convenient sometimes if waiting until a value is returned. Maybe change if such use case emerges.
491
492
/**
492
493
* Wait until a condition is true
493
494
* @param condition - wait until this callback function returns true
494
495
* @param timeOutMs - stop waiting after that many milliseconds, -1 for disable
495
496
* @param pollingIntervalMs - check condition between so many milliseconds
497
+
* @param failedMsgFn - append the string return value of this getter function to the error message, if given
498
+
* @return the (last) truthy value returned by the condition function
0 commit comments