# redux-convenient-utils

> 用来创建redux的Reducer和action常量

Latest version **1.0.2** (published 2016-12-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install redux-convenient-utils
pnpm add redux-convenient-utils
yarn add redux-convenient-utils
bun add redux-convenient-utils
```

## 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.2 |
| Published | 2016-12-19 |
| First published | 2016-12-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | leaves-27 |
| Maintainers | leaves-27 |
| Keywords | createConstants, createReducer |

## Links

- npm: https://www.npmjs.com/package/redux-convenient-utils
- Repository: https://github.com/leaves-27/redux-convenient-utils
- Homepage: https://github.com/leaves-27/redux-convenient-utils#readme
- Issues: https://github.com/leaves-27/redux-convenient-utils/issues
- npm.io page: https://npm.io/package/redux-convenient-utils

## Recent versions

- 1.0.2 (latest) — 2016-12-19
- 1.0.1 — 2016-12-08
- 1.0.0 — 2016-12-08

## README

# 安装

  npm install redux-convenient-utils --save

# 用法

  该包主要暴露了两个方法，一个用来创建redux的reducer，一个用来创建redux里面的action常量。具体如下：

      createReducer(initialState, reducerMap)：  
        initialState： <object> redux中的state。例如：
          {
                visibilityFilter: 'SHOW_ALL',
                todos: [
                  {
                    text: 'Consider using Redux',
                    completed: true,
                  },
                  {
                    text: 'Keep all state in a single tree',
                    completed: false
                  }
                ]
              }
        reducerMap：<object>集合action及其处理函数的映射关系的一个对象。例如：
        {
          [ActionTypes.ADD_TODO](state, action) {
            let text = action.text.trim();
            return [...state, text];
          }
        } 

      createConstants(...constants)： 
        constants：一个个常量。例如：“SET_STATE”、“MODIFY_STATE”

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