# then-while

> Call an (a)sync function until an (a)sync predicate returns false.

Latest version **0.1.0** (published 2017-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install then-while
pnpm add then-while
yarn add then-while
bun add then-while
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-03-20 |
| First published | 2017-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^6 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Seb Insua |
| Maintainers | sebinsua |
| Keywords | then, promise, while, async, sync, predicate |

## Links

- npm: https://www.npmjs.com/package/then-while
- Repository: https://github.com/sebinsua/then-while
- Homepage: https://github.com/sebinsua/then-while#readme
- Issues: https://github.com/sebinsua/then-while/issues
- npm.io page: https://npm.io/package/then-while

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^2
- [is-promise](https://npm.io/package/is-promise.md) ^2
- [any-promise](https://npm.io/package/any-promise.md) ^1

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-03-20
- 0.0.1 — 2017-03-20

## README

# `then-while`
> Call an (a)sync function until an (a)sync predicate returns false.

## Example

```js
const thenWhile = require('then-while')

const predicate = value => Promise.resolve(value < 0.5)
const performStep = message => Promise.resolve(`${(Math.random())}`)

const generateNumber = createThenWhile(predicate, performStep)

generateNumber('some arguments')
  .then(randomNumber => console.log('random number:', randomNumber))
```

## Install

```sh
yarn add then-while
```

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