Small utility promisification of polling.
npm install promise-waitfor
- promise-waitfor
- Documentation
- Examples




Just run ``npm install promise-waitfor`
`javascript`
Promise waitFor(Function condition, interval int=50)
`javascript
const waitFor = require('promise-waitfor');
waitFor(CONDITION)
.then(...)
waitFor(CONDITION, TEST_INTERVAL)
.then(...)
`
Alternatively, you can use a Promise constructor other than global.Promise:
`javascript`
const waitFor = require('promise-waitfor').use(YOUR_PROMISE_CONSTRUCTOR_HERE);
For now more info check test.js and the index.js for further information.
- Removed the second argument as it was generally confusing and can be easily replace with an extra .then() call, eg: waitFor(() => {...}, () => getSomething() can be converted to waitFor() => {...)).then(getSomething)
- Updated eslint config, eslint is now a dev dependency.