# compose-then

> A better implementation of the "compose" FP function that allows for composing both synchronous and asynchronous functions.

Latest version **1.0.1** (published 2017-09-13) · ISC license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2017-09-13 |
| First published | 2017-09-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | JP Erasmus |
| Maintainers | jperasmus |
| Keywords | compose, fp, functional, programming, async, asynchronous, promise |

## Links

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

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@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

## Recent versions

- 1.0.1 (latest) — 2017-09-13
- 1.0.0 — 2017-09-13

## README

# compose-then
A better implementation of the "compose" FP function that allows for composing both synchronous and asynchronous functions.

## Installation:
```
yarn add compose-then
```
or
```
npm install --save compose-then
```

## Example:

```js
import compose from 'compose-then';

const double = x => x * 2;
const square = x => x * x;
const plus3 = x => new Promise(resolve => setTimeout(() => resolve(x + 3), 100));

compose(double, square, plus3)(2)
  .then(result => // Result equals 50)
  .catch(console.error);

```

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