// 安装
yarn add redux-thunk
// 配置:当创建store时
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import resucer from './reducer';
const store = createStore(
resucer,
applyMiddleware(thunk)
);
// 安装
yarn add redux-thunk
// 配置:当创建store时
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import resucer from './reducer';
const store = createStore(
resucer,
applyMiddleware(thunk)
);
本文标题:redux-thunk中间件的使用
本文链接:https://www.haomeiwen.com/subject/jeevkctx.html
网友评论