Loop with setInterval until condition is true.
npm install do-whensetInterval until condition is truthy. We use it to test that third-party libraries have loaded the proper global variables onto window.Not great, I know. Have a better idea? Let me know.
``sh`
$ npm install do-when
$ component install segmentio/when
`js`
when(function () {
return requirement() === met;
}, function () {
doStuff();
});
When condition returns truthy, call the callback. Check every interval milliseconds, defaulting to 10`.
MIT