imdux Redux辅助库适用于React Hooks与TypeScript

Redux 状态管理的重复代码太多?嗯,用起来真的挺烦。imdux就是为你这种懒得写样板代码的人准备的,配合 React HooksTypeScript,体验还是蛮不错的。

没有冗余的 actionreducertypes 三连组合,直接一步到位,状态管理就像拧螺丝一样丝滑。它用的是 immer 来不可变数据,所以写起来跟操作普通对象没啥两样,响应也快,代码也清爽。

类型安全是它的另一个加分项,尤其你在用 TypeScript 的话,基本可以做到“写一个变量,类型全推出来”。以前那种一堆类型定义、接口声明,真的能省一半。

用法也挺简单。你可以用 npx create-react-app imdux-demo 快速创建个项目, yarn add imdux immer redux react-redux 一把装好所有依赖。再写个 useCounter 这样的 hook,几行代码搞定状态和派发,体验丝滑。

想看点例子或指南?可以看看这些相关链接,像是react-redux-typescript-guide,讲得还蛮细的,适合边学边用。

如果你正在用 React + TypeScript 搭项目,又不想在 Redux 上花太多时间,那我还挺推荐你试试 imdux 的。

zip
imdux-master.zip 预估大小:29个文件
folder
imdux-master 文件夹
file
.travis.yml 284B
file
webpack.dist.config.js 1KB
folder
docs 文件夹
file
5.gif 105KB
file
2.gif 41KB
file
1.gif 39KB
file
4.gif 335KB
file
3.png 18KB
file
package.json 2KB
file
tslint.json 2KB
file
webpack.dev.config.js 722B
file
jest.config.js 50B
file
package-lock.json 467KB
folder
static 文件夹
file
type.jpg 22KB
file
index.html 127B
file
redux_devtool.jpg 15KB
file
logo_2.png 70KB
folder
src 文件夹
file
createStore.ts 2KB
folder
test 文件夹
file
action.test.ts 2KB
file
imdux.test.ts 7KB
file
types.d.ts 2KB
file
vendor.d.ts 100B
file
createAction.ts 3KB
file
index.ts 131B
file
error.ts 610B
file
tsconfig.json 722B
file
.gitignore 31B
file
imdux.code-workspace 285B
file
README.md 12KB
file
babel.config.js 314B
zip 文件大小:587.25KB