# create-immutable-reducer

> Create reducer from object of action handlers for use with redux and immutable for state.

Latest version **1.0.1** (published 2016-06-15) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install create-immutable-reducer
pnpm add create-immutable-reducer
yarn add create-immutable-reducer
bun add create-immutable-reducer
```

## 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 | 2016-06-15 |
| First published | 2016-06-13 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Node | => 4.0.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sergey Sova |
| Maintainers | lestad |
| Keywords | reducer, immutable, redux, react, flux, object, action, js, create, reduce, store |

## Links

- npm: https://www.npmjs.com/package/create-immutable-reducer
- Repository: https://github.com/LestaD/create-immutable-reducer
- Homepage: https://github.com/LestaD/create-immutable-reducer#readme
- Issues: https://github.com/LestaD/create-immutable-reducer/issues
- npm.io page: https://npm.io/package/create-immutable-reducer

## Dependencies (2)

- [babel-cli](https://npm.io/package/babel-cli.md) ^6.10.1
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.9.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-06-15
- 1.0.0 — 2016-06-13

## README

# create-immutable-reducer

Create a redux reducer from an object of action handling functions, keyed by the actions they handle.
Has validates for Immutable state.

```js
const createReducer = require('create-immutable-reducer');
const { fromJS } = require('immutable');

const initialState = fromJS({
  first: 1,
  second: 2,
});

module.exports = createReducer({
  ACTION_TYPE_CHANGE_FIRST(state, action) {
    return state.set('first', action.first);
  },

  ACTION_TYPE_CHANGE_SECOND(state, { second }) {
    return state.set('second', second);
  },
}, initialState);
```

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