pole-wait
v1.0.0
Published
Wait until a pole poller responds with an expected result
Downloads
5
Maintainers
Readme
pole-wait
Wait until a pole poller responds with an expected result
Install
$ npm install --save pole-wait
Usage
var wait = require('pole-wait')
wait(poll, (data) => data.foo, function (err, data) {
console.log('got data!', data)
})
API
wait(poll, fn, callback)
-> undefined
poll
Required
Type: object
A poll interface returned from pole.
fn
Required
Type: function
Arguments: data
A function to be called with the poll result. If the return value is truthy, the wait is considered complete and the poller is cancelled.
callback
Required
Type: function
Arguments: err, data
License
MIT © Ben Drucker