pole-wait

1.0.0 • Public • Published

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

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i pole-wait

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • bendrucker