//用于创建store
import {applyMiddleware, legacy_createStore as createStore} from "redux"
import allReducer from "./reducers"//将多个reducer合并为一个
import thunk from "redux-thunk"  //引入异步模块
import {composeWithDevTools} from "redux-devtools-extension"

// store.dispatch({type: 'count', data: 1,}); // 提交

// 监听
// store.subscribe(() => {
//     this.setState({
//         num: store.getState().count,
//     })
// })

export default createStore(allReducer, composeWithDevTools(applyMiddleware(thunk)))//创建并导出store对象
