mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -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
|
@ -1,13 +1,10 @@
|
|||
import { combineReducers } from 'redux';
|
||||
import { enableBatching } from 'redux-batched-actions';
|
||||
import { routerReducer } from 'react-router-redux';
|
||||
import actions from 'Store/Actions';
|
||||
import { connectRouter } from 'connected-react-router';
|
||||
|
||||
const defaultState = {};
|
||||
|
||||
const reducers = {
|
||||
routing: routerReducer
|
||||
};
|
||||
const reducers = {};
|
||||
|
||||
actions.forEach((action) => {
|
||||
const section = action.section;
|
||||
|
@ -17,4 +14,10 @@ actions.forEach((action) => {
|
|||
});
|
||||
|
||||
export { defaultState };
|
||||
export default enableBatching(combineReducers(reducers));
|
||||
|
||||
export default function(history) {
|
||||
return enableBatching(combineReducers({
|
||||
...reducers,
|
||||
router: connectRouter(history)
|
||||
}));
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import { applyMiddleware, compose } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
import { routerMiddleware } from 'react-router-redux';
|
||||
import { routerMiddleware } from 'connected-react-router';
|
||||
import createSentryMiddleware from './createSentryMiddleware';
|
||||
import createPersistState from './createPersistState';
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { createStore } from 'redux';
|
||||
import reducers, { defaultState } from 'Store/Actions/reducers';
|
||||
import createReducers, { defaultState } from 'Store/Actions/createReducers';
|
||||
import middlewares from 'Store/Middleware/middlewares';
|
||||
|
||||
function createAppStore(history) {
|
||||
const appStore = createStore(
|
||||
reducers,
|
||||
createReducers(history),
|
||||
defaultState,
|
||||
middlewares(history)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue