基于 redux 的模块化且易于理解的状态管理,最少的代码片段
Redux Box
A modular, batteries-included container for Redux + Redux-Saga applications.
Less boilerplate. Cleaner reducers. Sagas already wired up.
anish000kumar.github.io/redux-box
npm install redux-box
# or
yarn add redux-box// store/counter.js
import { createModule } from 'redux-box';
export default createModule({
state: { count: 0 },
mutations: {
INCREMENT: state => { state.count += 1; },
},
});
// store/index.js
import { createStore } from 'redux-box';
import counter from './counter';
export default createStore({ counter });That's a complete Redux store. Mutations look mutable but are made immutable under the hood by Immer; sagas, devtools, and middleware are wired up for you.
➡️ Head over to the full documentation for the guide, examples, recipes, and API reference.
MIT © Anish Kumar
暂无开放 Issues,或尚未同步最近议题。