Runs the callback function every specified interval and returns a Promise that resolves when the callback returns
any other value than null, undefined or false.
If your callback throws (or Promise rejects) it will stop the interval and reject the returned Promise.
To avoid that use:
waitFor(() =>promiseReturningFunction().catch(() =>null)); // or waitFor(() =>safe(() =>functionThatThrows()));
Runs the callback function every specified interval and returns a Promise that resolves when the callback returns any other value than
null
,undefined
orfalse
. If your callback throws (or Promise rejects) it will stop the interval and reject the returned Promise. To avoid that use: