Last active
October 9, 2021 04:03
-
-
Save xiongemi/88e4b5e8ac19248f709aad5c2a7e8094 to your computer and use it in GitHub Desktop.
aztro daily horoscope blog root store with horoscope
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 { initialHoroscopeState } from '../horoscope/horoscope.slice'; | |
| import { RootState } from './root-state.interface'; | |
| export const initialRootState: RootState = { | |
| horoscope: initialHoroscopeState | |
| }; |
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 { HoroscopeState } from '../horoscope/horoscope.slice'; | |
| export interface RootState { | |
| horoscope: HoroscopeState; | |
| } |
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 '@reduxjs/toolkit'; | |
| import { horoscopeSlice } from '../horoscope/horoscope.slice'; | |
| import { RootState } from './root-state.interface'; | |
| export const rootReducer = combineReducers<RootState>({ | |
| horoscope: horoscopeSlice.reducer, | |
| }); |
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 { configureStore } from '@reduxjs/toolkit'; | |
| import { initialRootState } from './root-state.initial'; | |
| import { rootReducer } from './root.reducer'; | |
| declare const process: any; | |
| const isDevelopment = process.env.NODE_ENV === 'development'; | |
| const rootStore = configureStore({ | |
| reducer: rootReducer, | |
| middleware: (getDefaultMiddleware) => getDefaultMiddleware(), | |
| devTools: isDevelopment, | |
| preloadedState: initialRootState, | |
| }); | |
| export { rootStore }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment