Have main and listSystems working

This commit is contained in:
Luke Berndt
2021-01-01 12:04:37 -05:00
parent ac6b9903a6
commit 79fe8113e0
24 changed files with 881 additions and 246 deletions

View File

@@ -0,0 +1,26 @@
// https://github.com/supasate/connected-react-router
// configureStore.js
import { createBrowserHistory } from 'history'
import { applyMiddleware, compose, createStore } from 'redux'
import { routerMiddleware } from 'connected-react-router'
import createRootReducer from './reducers'
import thunk from 'redux-thunk';
export const history = createBrowserHistory()
export default function configureStore(preloadedState) {
const store = createStore(
createRootReducer(history), // root reducer with router state
preloadedState,
compose(
applyMiddleware(
routerMiddleware(history), // for dispatching history actions
thunk,
// ... other middlewares ...
),
),
)
return store
}

View File

@@ -0,0 +1,13 @@
// from https://github.com/supasate/connected-react-router
import { combineReducers } from 'redux'
import { connectRouter } from 'connected-react-router'
import systemReducer from "../System/system-reducer"
const createRootReducer = (history) => combineReducers({
router: connectRouter(history),
system: systemReducer,
})
export default createRootReducer