# redux-helps

> a redux and redux-saga helps

Latest version **1.2.0** (published 2019-12-21) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2019-12-21 |
| First published | 2018-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 33.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yupeilin |
| Maintainers | yupeilin |
| Keywords | redux, redux-saga, helps, tansform |

## Links

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

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2019-12-21
- 1.1.0 — 2019-04-16
- 1.0.4 — 2019-04-15
- 1.0.3 — 2019-04-15
- 1.0.2 — 2019-02-12
- 1.0.1 — 2019-01-21
- 1.0.0 — 2018-12-18
- 0.2.0 — 2018-10-05
- 0.1.2 — 2018-09-13
- 0.1.1 — 2018-09-11
- 0.1.0 — 2018-09-11
- 0.0.1 — 2018-09-06

## README

# redux-helps

`redux-helps` 是一个工具方法集，在使用 `redux` 的情况下，可以简化 `redux` 的 `reducers` 聚合，或者在使用 `redux-saga` 的情况下，可以简化 `redux-saga` 的 `effects` 的聚合。并且 `reducers` 和 `effects` 可以联合使用。

## 开始

### 安装

```
npm install redux-helps --save
```

### 如何使用

使用 `transformModal`，得到一个 `reducer` 和 `effect` 。

### 新特性

使用了 `promiseMiddleware` 中间件，在 `action` 是 `effects` 时，就可以使用 `dispatch().then()`。

```javascript
const rootModal = {
  counter: {
    namespace: 'counter',
    effects: {
      *asyncResolve({ payload }) {
        yield delay(500)
        return payload
      }
    }
  }
}
const { reducers, effects } = transformModal(rootModal);
const sagaMiddleware = createSagaMiddleware();
// need promiseMiddleware(effects)
const store = createStore(combineReducers(reducers), applyMiddleware(promiseMiddleware(effects), sagaMiddleware));
sagaMiddleware.run(effects);
store.dispatch({ type: 'counter/asyncResolve', payload: 10000 }).then(res => {
  consolg.log(res) // 10000
})
```

## 参与贡献

非常欢迎你的贡献，你可以通过以下方式和我们一起共建：

- 通过 Issue bug 或进行咨询。
- 提交 Pull Request 改进代码。

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