# create-redux-reducer-from-map

> My personal preference for eliminating the Redux switch statements

Latest version **1.0.0** (published 2016-03-11) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install create-redux-reducer-from-map
pnpm add create-redux-reducer-from-map
yarn add create-redux-reducer-from-map
bun add create-redux-reducer-from-map
```

## 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 | 2016-03-11 |
| First published | 2016-03-11 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | TehShrike |
| Maintainers | tehshrike |
| Keywords | redux, reducer |

## Links

- npm: https://www.npmjs.com/package/create-redux-reducer-from-map
- Repository: https://github.com/TehShrike/create-redux-reducer-from-map
- Homepage: https://github.com/TehShrike/create-redux-reducer-from-map#readme
- Issues: https://github.com/TehShrike/create-redux-reducer-from-map/issues
- npm.io page: https://npm.io/package/create-redux-reducer-from-map

## Recent versions

- 1.0.0 (latest) — 2016-03-11

## README

My own personal preference for building reducers for Redux.

```js

var makeReducer = require('create-redux-reducer-from-map')

const arithmeticReducer = makeReducer({
	ADD: (state, action) => state + action.payload,
	SUBTRACT: (state, action) => state - action.payload
}, 0)


```

# makeReducer(mapOfFunctions[, initialState])

Returns a reducer appropriate for Redux.  Takes an map of action types to functions taking `(state, action)`.

# License

[WTFPL](http://wtfpl2.com/)

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