📅  最后修改于: 2022-03-11 15:01:53.380000             🧑  作者: Mango
import { applyMiddleware, compose, createStore } from "redux";
import thunk from "redux-thunk";
import rootReducer from "./rootReducer";
// for this we'll use Redux "compose" function
const enhancers = compose(
applyMiddleware(thunk), // your own middleware
window.devToolsExtension ? window.__REDUX_DEVTOOLS_EXTENSION__() : (f) => f
);// devtools middleware
export const store = createStore(rootReducer, enhancers);