redux-mutation
API完全继承redux,然后有新增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
-
无变化的 API
-
不采用的 API
如果要使用,请直接使用
redux
的。import { bindActionCreators } from 'redux';
const store = createStore(mutations);
//或者 const store = configCreateStore(...args)(mutations)
const {
dispatch,
getState,
subscribe,
replaceReducer,
replaceMutations,
} = store;
-
有变化和新增的 API
-
无变化的 API
-
store.replaceReducer(nextReducer)
兼容
redux
replaceReducer
,reducer
模式建议使用replaceMutations
。
centerEnhancer(originalCenter,centerUtils,currentMutation,actionType)