import { applyMiddleware, legacy_createStore as createStore } from 'redux'
import rootReducer from './reducer'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunk from 'redux-thunk'

// 创建仓库实例
const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)))


export type RootState = ReturnType<typeof store.getState>


export type AppDispatch = typeof store.dispatch
// 导出仓库实例
export default store