- react-redux
- react-thunk
- redux
Last active
February 5, 2022 05:29
-
-
Save dialguiba/d959c7824cd0ed5885b9a648c57a1346 to your computer and use it in GitHub Desktop.
react-store
This file contains hidden or 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
import { Provider } from "react-redux"; | |
import { AppRouter } from "./router/AppRouter"; | |
import { store } from "./store/store"; | |
export const CalendarApp = () => { | |
return ( | |
<Provider store={store}> | |
<AppRouter /> | |
</Provider> | |
); | |
}; |
This file contains hidden or 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
import { combineReducers } from "redux"; | |
import { authReducer } from "./authReducer"; | |
import { calendarReducer } from "./calendarReducer"; | |
import { uiReducer } from "./uiReducer"; | |
export const rootReducer = combineReducers({ | |
ui: uiReducer, | |
calendar: calendarReducer, | |
auth: authReducer, | |
// TODO: CAlendarReducer | |
}); |
This file contains hidden or 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
import { applyMiddleware, compose, createStore } from "redux"; | |
import thunk from "redux-thunk"; | |
import { rootReducer } from "../reducers/rootReducer"; | |
const composeEnhancers = (typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose; | |
export const store = createStore(rootReducer, composeEnhancers(applyMiddleware(thunk))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment