# pole-wait

> Wait until a pole poller responds with an expected result

Latest version **1.0.0** (published 2016-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install pole-wait
pnpm add pole-wait
yarn add pole-wait
bun add pole-wait
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-06-25 |
| First published | 2016-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | pole, poll, event, callback, wait, await |

## Links

- npm: https://www.npmjs.com/package/pole-wait
- Repository: https://github.com/bendrucker/pole-wait
- Homepage: https://github.com/bendrucker/pole-wait#readme
- Issues: https://github.com/bendrucker/pole-wait/issues
- npm.io page: https://npm.io/package/pole-wait

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-06-25

## README

# pole-wait [![Build Status](https://travis-ci.org/bendrucker/pole-wait.svg?branch=master)](https://travis-ci.org/bendrucker/pole-wait)

> Wait until a [pole](https://github.com/bendrucker/pole) poller responds with an expected result


## Install

```
$ npm install --save pole-wait
```


## Usage

```js
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](https://github.com/bendrucker/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](http://bendrucker.me)

---
_Source: https://npm.io/package/pole-wait · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
