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
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -528,29 +528,35 @@ export async function sleep(ms: number = 0) {
528
528
})
529
529
}
530
530
531
+
// 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.
531
532
/**
532
533
* Wait until a condition is true
533
534
* @param condition - wait until this callback function returns true
534
535
* @param timeOutMs - stop waiting after that many milliseconds, -1 for disable
535
536
* @param pollingIntervalMs - check condition between so many milliseconds
537
+
* @param failedMsgFn - append the string return value of this getter function to the error message, if given
538
+
* @return the (last) truthy value returned by the condition function
0 commit comments