Package Exports
- @guiguzixl/redux-add-reducer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@guiguzixl/redux-add-reducer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
redux-add-reducer
Redux enhancer which adds dynamically reducer
install
npm install --save @guiguzixl/redux-add-reducer
or
yarn add @guiguzixl/redux-add-reducerexample
单独使用
import { createStore } from 'redux'
import addReducer from '@guiguzixl/redux-add-reducer'
const store = createStore(reducer, preloadState, addReducer)配合其他 redux enhancer 使用
import { createStore, compose } from 'redux'
import addReducer from '@guiguzixl/redux-add-reducer'
const store = createStore(reducer, preloadState, compose(...otherEnhancer,addReducer))添加 reducer
store.addReducer({
reducerKey: reducerFunction,
})