Hard-Reducer类型友好的 Redux 辅助工具
Hard-Reducer 提供了一个强类型的简洁门面,让 Redux 使用体验更加友好。通过以下命令安装它:npm install hard-reducer --save
或 yarn add hard-reducer
。Hard-Reducer 的主要设计思想是确保类型安全的接口,避免多余的类型字符串定义,保留 Redux 的 combineReducers()
功能,以便处理标准的 Flux 操作对象 { type: string, payload: Payload }
。以下示例展示了它在 Flowtype 和 Typescript 中的兼容性:
/* @flow */
// Flow 的魔法注释,Typescript 会忽略它
import { buildActi
更多代码示例详见文档。
hard-reducer-master.zip
预估大小:21个文件
hard-reducer-master
文件夹
circle.yml
962B
.flowconfig
93B
yarn.lock
113KB
.prettierignore
24B
src
文件夹
createReducer.js
1KB
index.js
142B
buildActionCreator.js
2KB
.babelrc
33B
50.65KB
文件大小:
评论区