license declare global { interface Window { process ? : Object ; __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? : typeof compose ; } } import { createStore , applyMiddleware , compose , combineReducers , StoreEnhancer , Action , Reducer , } from 'redux' ; import thunk , { ThunkMiddleware } from 'redux-thunk' ; import { lazyReducerEnhancer } from 'pwa-helpers' ; import { AppAction } from './actions/app.js' ; import { FavoritesAction } from './actions/favorites.js' ; import { ItemsAction } from './actions/items.js' ; import { ListsAction } from './actions/lists.js' ; import { UsersAction } from './actions/users.js' ; import app , { AppState } from './reducers/app.js' ; import { FavoritesState } from './reducers/favorites.js' ; import { ItemsState } from './reducers/items.js' ; import { ListsState } from './reducers/lists.js' ; import { UsersState } from './reducers/users.js' ; export interface RootState { app : AppState ; favorites : FavoritesState ; items : ItemsState ; lists : ListsState ; users : UsersState ; } export type RootAction = AppAction | FavoritesAction | ItemsAction | ListsAction | UsersAction | Action < '' > ; const devCompose = window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose ; export const store = createStore ( state => state as Reducer < RootState , RootAction > , devCompose ( lazyReducerEnhancer ( combineReducers ) , applyMiddleware ( thunk as ThunkMiddleware < RootState , RootAction > ) ) ) ; store . addReducers ( { app , } ) ;