1.0.0 • Published 8 years ago

pole-wait v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

pole-wait Build Status

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