import { createStore, applyMiddleware, Store } from 'redux' import { composeWithDevTools } from 'redux-devtools-extension' import thunk from 'redux-thunk' import { createEpicMiddleware, EpicMiddleware } from 'redux-observable' import { rootReducer } from './reducers' import { rootEpic } from './epics' const epicMiddleware: EpicMiddleware = createEpicMiddleware(); const middleware = [thunk, epicMiddleware] import { AppState } from './state'; import { Actions } from './actions'; const composeEnhancers = composeWithDevTools({ name: "IT Corpo React App" }); export const getStore = (): Store => { const store = createStore(rootReducer, composeEnhancers( applyMiddleware(...middleware), // other store enhancers... )) epicMiddleware.run(rootEpic); return store; }