# redux-compose-hors

> Combine higher order reducers

Latest version **1.0.0** (published 2017-03-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install redux-compose-hors
pnpm add redux-compose-hors
yarn add redux-compose-hors
bun add redux-compose-hors
```

## 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.0 |
| Published | 2017-03-07 |
| First published | 2017-03-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leigh Silverstein |
| Maintainers | l2silver |
| Keywords | redux, compose, hors, redux-compose-hors, batched-actions |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2017-03-07

## README

redux-compose-hors
=====================

Compose higher order reducers

[![Build Status](https://travis-ci.org/l2silver/redux-compose-hors.svg?branch=master)](https://travis-ci.org/l2silver/redux-compose-hors)

## Why
If you use two or more higher order reducers, then the actions of those reducers must follow the same order that the higher order reducers are in. Furthermore, those reducers cannot be nested beyond two degrees.

```
npm install --save redux-compose-hors
```

## Usage

```
import {createStore} from 'redux';
import {batchActions, enableBatching} from 'redux-batched-actions';
import {retypeAction, enableRetyping} from 'redux-retype-actions';
import composeHors from 'redux-compose-hors';
import {createAction} from 'redux-actions';

const doThing = createAction('DO_THING')
const doOther = createAction('DO_OTHER')

function reducer(state, action) {
  switch (action.type) {
    case 'DO_THING': return 'thing'
    case 'DO_OTHER': return 'other'
    default: return state
  }
}

const store = createStore(composeHors(reducer, enableRetyping, enableBatching), initialState)
const doMultipleThings = retypeAction('DO_MULTIPLE_THINGS', batchActions([doThing(), doOther()]))
const doMultipleThingsTwice = batchActions([doMultipleThings, doMultipleThings])
store.dispatch(doMultipleThingsTwice)
```

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