在model中怎么同时发起多次请求,因为yield将异步请求转为同步请求了,所以请求会按照同步顺序依次执行,使请求时间延长
错误写法
// effects将按顺序执行const response = yield call(fetch, '/users');const res = yield call(fetch, '/roles');
正确写法
// effects将会同步执行 const [response, res] = yield [ call(fetch, '/users'), call(fetch, '/roles'), ]
发表评论 取消回复