-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #432 from mlibrary/replace-createstore-with-config…
…urestore Replace `createStore` with `configureStore`.
- Loading branch information
Showing
12 changed files
with
98 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import listsReducer from './reducer'; | ||
import GoToList from './components/GoToList'; | ||
import AddToListButton from './components/AddToListButton'; | ||
import ActionsList from './components/ActionsList'; | ||
import ActionStatusMessage from './components/ActionStatusMessage'; | ||
import ActionsList from './components/ActionsList'; | ||
import AddToListButton from './components/AddToListButton'; | ||
import GoToList from './components/GoToList'; | ||
import List from './components/List'; | ||
import isInList from './isInList.js'; | ||
import prejudice from './prejudice.js'; | ||
|
||
export { | ||
GoToList, | ||
List, | ||
ActionStatusMessage, | ||
ActionsList, | ||
AddToListButton, | ||
listsReducer, | ||
GoToList, | ||
isInList, | ||
ActionsList, | ||
prejudice, | ||
ActionStatusMessage | ||
List, | ||
prejudice | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import profileReducer from './reducer'; | ||
import { addProfile } from './actions'; | ||
import setupProfile from './setupProfile'; | ||
import AuthenticationRequired from './components/AuthenticationRequired'; | ||
import Authentication from './components/Authentication'; | ||
import AuthenticationRequired from './components/AuthenticationRequired'; | ||
import setupProfile from './setupProfile'; | ||
import useIsAuthenticated from './use-is-authenticated'; | ||
|
||
export { | ||
profileReducer, | ||
addProfile, | ||
setupProfile, | ||
AuthenticationRequired, | ||
Authentication, | ||
AuthenticationRequired, | ||
setupProfile, | ||
useIsAuthenticated | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { addSpecialists } from './actions'; | ||
import Specialists from './components/Specialists'; | ||
import specialistsReducer from './reducer'; | ||
|
||
export { | ||
addSpecialists, | ||
Specialists, | ||
specialistsReducer | ||
Specialists | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,44 @@ | ||
import { | ||
createStore, | ||
combineReducers, | ||
applyMiddleware | ||
} from 'redux'; | ||
import { connectRouter, routerMiddleware } from 'connected-react-router'; | ||
import { composeWithDevTools } from '@redux-devtools/extension'; | ||
import { configureStore } from '@reduxjs/toolkit'; | ||
import { SET_A11Y_MESSAGE } from './modules/a11y/actions'; | ||
import { advancedReducer } from './modules/advanced'; | ||
import { affiliationReducer } from './modules/affiliation'; | ||
import { browseReducer } from './modules/browse'; | ||
import { datastoresReducer } from './modules/datastores'; | ||
import { searchReducer } from './modules/search'; | ||
import { recordsReducer } from './modules/records'; | ||
import { filtersReducer } from './modules/filters'; | ||
import { advancedReducer } from './modules/advanced'; | ||
import { institutionReducer } from './modules/institution'; | ||
import { browseReducer } from './modules/browse'; | ||
import { specialistsReducer } from './modules/specialists'; | ||
import { listsReducer } from './modules/lists'; | ||
import { a11yReducer } from './modules/a11y'; | ||
import { profileReducer } from './modules/profile'; | ||
import { affiliationReducer } from './modules/affiliation'; | ||
|
||
import { ADD_PROFILE } from './modules/profile/actions'; | ||
import { ADD_LIST } from './modules/lists/actions'; | ||
import { recordsReducer } from './modules/records'; | ||
import { connectRouter, routerMiddleware } from 'connected-react-router'; | ||
import history from './history'; | ||
import { searchReducer } from './modules/search'; | ||
import { ADD_SPECIALISTS } from './modules/specialists/actions'; | ||
|
||
const rootReducer = combineReducers({ | ||
router: connectRouter(history), | ||
datastores: datastoresReducer, | ||
records: recordsReducer, | ||
search: searchReducer, | ||
filters: filtersReducer, | ||
advanced: advancedReducer, | ||
institution: institutionReducer, | ||
browse: browseReducer, | ||
specialists: specialistsReducer, | ||
lists: listsReducer, | ||
a11y: a11yReducer, | ||
profile: profileReducer, | ||
affiliation: affiliationReducer | ||
}); | ||
|
||
const middleware = [routerMiddleware(history)]; | ||
const simpleReducer = (actionType, initialState = {}) => { | ||
return (state = initialState, action) => { | ||
return action.type === actionType ? action.payload : state; | ||
}; | ||
}; | ||
|
||
const store = createStore( | ||
rootReducer, | ||
composeWithDevTools(applyMiddleware(...middleware)) | ||
); | ||
const store = configureStore({ | ||
reducer: { | ||
a11y: simpleReducer(SET_A11Y_MESSAGE, { message: '' }), | ||
advanced: advancedReducer, | ||
affiliation: affiliationReducer, | ||
browse: browseReducer, | ||
datastores: datastoresReducer, | ||
filters: filtersReducer, | ||
institution: institutionReducer, | ||
lists: simpleReducer(ADD_LIST), | ||
profile: simpleReducer(ADD_PROFILE), | ||
records: recordsReducer, | ||
router: connectRouter(history), | ||
search: searchReducer, | ||
specialists: simpleReducer(ADD_SPECIALISTS, []) | ||
}, | ||
middleware: (getDefaultMiddleware) => { | ||
return getDefaultMiddleware().concat(routerMiddleware(history)); | ||
} | ||
}); | ||
|
||
export default store; |