applyPlugin
applyPlugin(...plugins)
applyPlugin
是用来合并多个插件,有点类似redux
的applyMiddleware
。
引入
import { applyPlugin } form 'redux-mutation';
参数
...plugins
(...object)结构如下:
{ extraCenters: {}, extraReducers: {}, reducerEnhancer: originalReducer => (state, action) => { return originalReducer(state, action); }, centerEnhancer: ( originalCenter, { put }, currentMutationOjbect, actionType ) => (...args) => { return originalCenter(...args); }, }
返回值
返回合并后的plugin
配置。
{
extraCenters: {...},
extraReducers: {...},
reducerEnhancer: function(){},
centerEnhancer: function(){},
}
例子
请看插件使用
Last updated
Was this helpful?