# @mqschwanda/compose

> `compose(...functions)`

Latest version **0.0.1** (published 2018-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mqschwanda/compose
pnpm add @mqschwanda/compose
yarn add @mqschwanda/compose
bun add @mqschwanda/compose
```

## 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.0.1 |
| Published | 2018-08-17 |
| First published | 2018-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | mqschwanda |
| Keywords | react, data, react, compose |

## Links

- npm: https://www.npmjs.com/package/@mqschwanda/compose
- Repository: https://github.com/mqschwanda/node-monorepo
- Homepage: https://github.com/mqschwanda/node-monorepo/tree/master/packages/compose
- Issues: https://github.com/mqschwanda/node-monorepo/issues
- npm.io page: https://npm.io/package/@mqschwanda/compose

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.4.2
- [firebase](https://npm.io/package/firebase.md) ^5.3.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2018-08-17

## README

# compose

`compose(...functions)`

Composes functions from right to left.

This is a functional programming utility, and is included in Redux as a convenience.  
You might want to use it to apply several functions in a row.

#### Arguments

1. (*arguments*): The functions to compose. Each function is expected to accept a single parameter. Its return value will be provided as an argument to the function standing to the left, and so on. The exception is the right-most argument which can accept multiple parameters, as it will provide the signature for the resulting composed function.

#### Returns

(*Function*): The final function obtained by composing the given functions from right to left.

#### Example

This example demonstrates how to use `compose` to enhance a [store](Store.md) with [`applyMiddleware`](applyMiddleware.md) and a few developer tools from the [redux-devtools](https://github.com/reduxjs/redux-devtools) package.

```js
import compose from '@mqschwanda/compose';
import { connect } from 'redux'; // redux connect container
import passthrough from 'react-passthrough'; // react passthrough container

const container = compose(
  connect((store) => ({ store })),
  passthrough({ omit: ['dispatch'] }),
);
```

#### Tips

* All `compose` does is let you write deeply nested function transformations without the rightward drift of the code. Don't give it too much credit!

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