-
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.
moving all redux code to shared repo
- Loading branch information
Showing
5 changed files
with
26 additions
and
41 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
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
35 changes: 17 additions & 18 deletions
35
packages/guttersnipe-shared/redux/store/configureStore.dev.js
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,26 +1,25 @@ | ||
import { createStore, applyMiddleware, compose } from "redux"; | ||
import rootReducer from "../reducers"; | ||
import createSagaMiddleware from "redux-saga"; | ||
import reduxImmutableStateInvariant from "redux-immutable-state-invariant"; | ||
import thunk from "redux-thunk"; | ||
import logger from "redux-logger"; | ||
import rootSaga from "../sagas/shareables"; | ||
|
||
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; | ||
const sagaMiddleware = createSagaMiddleware(); | ||
|
||
module.exports = function configureStore(initialState) { | ||
console.log("initial state", initialState); | ||
const composeEnhancers = | ||
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; | ||
|
||
return createStore( | ||
rootReducer, | ||
initialState.default, | ||
composeEnhancers(applyMiddleware(thunk)) | ||
); | ||
const store = createStore( | ||
rootReducer, | ||
// initialState, | ||
composeEnhancers(applyMiddleware( | ||
sagaMiddleware, | ||
logger, | ||
reduxImmutableStateInvariant() | ||
)) | ||
); | ||
|
||
sagaMiddleware.run(rootSaga); | ||
export {store}; | ||
|
||
// | ||
/* TODO: InitialState must match rootReducer | ||
initialState, | ||
composeEnhancers( | ||
applyMiddleware(thunk, reduxImmutableStateInvariant(), | ||
logger)) | ||
); | ||
*/ | ||
}; |
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