mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-13 09:17:30 -05:00
Gettign going
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
|
||||
import { createBrowserHistory } from 'history'
|
||||
import { applyMiddleware, compose, createStore } from 'redux'
|
||||
import { routerMiddleware } from 'connected-react-router'
|
||||
import { createRouterMiddleware } from '@lagunovsky/redux-react-router'
|
||||
import createRootReducer from './reducers'
|
||||
import thunk from 'redux-thunk';
|
||||
import { apiSlice } from '../features/api/apiSlice'
|
||||
|
||||
export const history = createBrowserHistory()
|
||||
|
||||
@@ -15,12 +16,14 @@ export default function configureStore(preloadedState) {
|
||||
preloadedState,
|
||||
compose(
|
||||
applyMiddleware(
|
||||
routerMiddleware(history), // for dispatching history actions
|
||||
createRouterMiddleware(history), // for dispatching history actions
|
||||
thunk,
|
||||
apiSlice.middleware,
|
||||
// ... other middlewares ...
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
return store
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
|
||||
// from https://github.com/supasate/connected-react-router
|
||||
import { combineReducers } from 'redux'
|
||||
import { connectRouter } from 'connected-react-router'
|
||||
import { createRouterReducer } from '@lagunovsky/redux-react-router'
|
||||
import systemReducer from "../System/system-reducer"
|
||||
import talkgroupReducer from "../Talkgroups/talkgroup-reducer"
|
||||
import groupReducer from "../Group/group-reducer"
|
||||
import errorReducer from "../System/error-reducer"
|
||||
import statisticReducer from "../System/statistic-reducer"
|
||||
import permissionReducer from "../Permission/permission-reducer"
|
||||
import userReducer from "../User/user-reducer"
|
||||
import { userSlice, userReducer } from '../features/user/userSlice'
|
||||
import {apiSlice} from "../features/api/apiSlice"
|
||||
|
||||
const createRootReducer = (history) => combineReducers({
|
||||
router: connectRouter(history),
|
||||
router: createRouterReducer (history),
|
||||
system: systemReducer,
|
||||
statistic: statisticReducer,
|
||||
talkgroup: talkgroupReducer,
|
||||
group: groupReducer,
|
||||
user: userReducer,
|
||||
error: errorReducer,
|
||||
permission: permissionReducer
|
||||
permission: permissionReducer,
|
||||
[apiSlice.reducerPath]: apiSlice.reducer,
|
||||
|
||||
})
|
||||
export default createRootReducer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user