# hoc-compose

> Compose multiple higher-order components with easy to read single function compose()

Latest version **1.0.2** (published 2019-04-24) · MIT license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2019-04-24 |
| First published | 2019-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | andygock |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2019-04-24
- 1.0.1 — 2019-04-22
- 1.0.0 — 2019-04-22

## README

Single `compose()` function, taken from Andrew Clark's [recompose](https://github.com/acdlite/recompose) library.

```js
const composedHoc = compose(hoc1, hoc2, hoc3)

// Same as
const composedHoc = BaseComponent => hoc1(hoc2(hoc3(BaseComponent)))
```

Install:

```
npm i -s hoc-compose
```

Example usage:

```js
import { compose } from 'hoc-compose'

// ... your code

export default compose(
  withRouter,
  withApi,
  withStyles(styles)
)(MyComponent);

```

Would be equivalent to exporting with:

```js
export default withRouter(withApi(withStyles(styles)(MyComponent)));
```

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