Delays until predicate returns true. Can be useful for synchronising with other async activities.
predicate
// Delay until 'count' reaches 5await sleepWhile(() => count >= 5, 100); Copy
// Delay until 'count' reaches 5await sleepWhile(() => count >= 5, 100);
Delays until
predicate
returns true. Can be useful for synchronising with other async activities.