API 文档
redux-mutation API完全继承redux,然后有新增API和小改动。
[参数]中括号代表可选。
顶层 API
import
import {
combineReducers,
applyMiddleware,
//new and changed api below
compose,
createStore,
configCreateStore,
applyPlugin,
SEPARATOR,
} from 'redux-mutation';umd
const {
combineReducers,
applyMiddleware,
//new and changed api below
compose,
createStore,
configCreateStore,
applyPlugin,
SEPARATOR,
} = window.ReduxMutation;不采用的 API
如果要使用,请直接使用
redux的。import { bindActionCreators } from 'redux';
Store API
const store = createStore(mutations);
//或者 const store = configCreateStore(...args)(mutations)
const {
dispatch,
getState,
subscribe,
replaceReducer,
replaceMutations,
} = store;有变化和新增的 API
无变化的 API
store.replaceReducer(nextReducer)
兼容
reduxreplaceReducer,reducer模式建议使用replaceMutations。
其他 API
Center
CenterEnhancer
centerEnhancer(originalCenter,centerUtils,currentMutation,actionType)
ReducerEnhancer
Last updated
Was this helpful?