import { createStore , combineReducers , applyMiddleware , compose } from 'redux' ; import thunk from 'redux-thunk' ; import * as ducks from './ducks' ; import api from './middlewares/apiMiddleware' ; import { AuthReducerState } from './ducks/auth' ; import { SinglebugReducerState } from './ducks/single-bug' ; const composeSetup = process . env . NODE_ENV !== 'production' && typeof window === 'object' && ( window as any ) . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? ( window as any ) . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : compose ; export interface StoreState { bugs : any [ ] ; auth : AuthReducerState ; singlebug : SinglebugReducerState ; loading : { [ x ] : boolean ; } ; error : { [ x ] : string ; } ; } const reducers = combineReducers ( ducks ) ; const INITIAL_STATE = { } ; const store = createStore ( reducers , INITIAL_STATE , composeSetup ( applyMiddleware ( thunk , api ) ) ) ; export default store ;