# redux-hor

> Higher-order Reducers for Redux

Latest version **0.0.7** (published 2018-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-hor
pnpm add redux-hor
yarn add redux-hor
bun add redux-hor
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2018-10-09 |
| First published | 2018-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Paweł Maciejewski |
| Maintainers | pwlmaciejewski |
| Keywords | redux, higher-order function, FP, utility |

## Links

- npm: https://www.npmjs.com/package/redux-hor
- Repository: https://github.com/pwlmaciejewski/redux-hor
- npm.io page: https://npm.io/package/redux-hor

## Dependencies (1)

- [redux](https://npm.io/package/redux.md) ^4.0.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2018-10-09
- 0.0.6 — 2018-10-09
- 0.0.5 — 2018-10-09
- 0.0.4 — 2018-10-06
- 0.0.3 — 2018-10-06
- 0.0.2 — 2018-10-06
- 0.0.1 — 2018-10-06

## README

Redux-HOR
-----

Higher-order Redux is a utility belt for Redux that makes
heavy use of **higher-order reducers** to provide:

* Reduced boilerplate 🔩
* Increased modularity 📦
* Development speedup 🚄

Oh, btw... Higher-order reducer is a function that takes a reducer argument and returns a new reducer:

```typescript
HigherOrderReducer<State, Action> = (innerReducer: Reducer<State, Action>): Reducer<State, Action>
```


## Installation

```
yarn add redux-hor
```


## Quick start

Here's a standard reducer that we all know an love:

```typescript
export default function reducer (state = initialState, action) {
  if (action.type === 'UPDATE_AUTHOR') {
    return {
      ...state,
      author: action.payload
    }
  }

  return state
}
```

Compare it with HoR style:

```typescript
import { compose, withActionType, withInitialState, mergeState, identity } from 'redux-hor'

export compose(
  onAction('UPDATE_AUTHOR', () => merge({ author: action.payload }))
)(init(initialState))
```

## API docs

[Read them here](./API.md)

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