mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-10 23:33:38 -07:00
New: Replace 'react-router-redux' with 'connected-react-router'
This commit is contained in:
parent
df65b5b290
commit
f43c1e749f
12 changed files with 59 additions and 48 deletions
23
frontend/src/Store/Actions/createReducers.js
Normal file
23
frontend/src/Store/Actions/createReducers.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { combineReducers } from 'redux';
|
||||
import { enableBatching } from 'redux-batched-actions';
|
||||
import actions from 'Store/Actions';
|
||||
import { connectRouter } from 'connected-react-router';
|
||||
|
||||
const defaultState = {};
|
||||
const reducers = {};
|
||||
|
||||
actions.forEach((action) => {
|
||||
const section = action.section;
|
||||
|
||||
defaultState[section] = action.defaultState;
|
||||
reducers[section] = action.reducers;
|
||||
});
|
||||
|
||||
export { defaultState };
|
||||
|
||||
export default function(history) {
|
||||
return enableBatching(combineReducers({
|
||||
...reducers,
|
||||
router: connectRouter(history)
|
||||
}));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue