Skip to content

Instantly share code, notes, and snippets.

@xiongemi
Last active October 9, 2021 04:03
Show Gist options
  • Select an option

  • Save xiongemi/88e4b5e8ac19248f709aad5c2a7e8094 to your computer and use it in GitHub Desktop.

Select an option

Save xiongemi/88e4b5e8ac19248f709aad5c2a7e8094 to your computer and use it in GitHub Desktop.
aztro daily horoscope blog root store with horoscope
import { initialHoroscopeState } from '../horoscope/horoscope.slice';
import { RootState } from './root-state.interface';
export const initialRootState: RootState = {
horoscope: initialHoroscopeState
};
import { HoroscopeState } from '../horoscope/horoscope.slice';
export interface RootState {
horoscope: HoroscopeState;
}
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,
});
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