我试图获取studentDataPromise之前,fetchLoansPromise因为它取决于数据studentDataPromise返回。
这是我当前的代码:
Promise.all([studentDataPromise, fetchclassesPromise, fetchLoansPromise])
.then(() => {
toggleIsReady();
})
.catch(error => {
throw new Error(error);
});
这是当前的事件顺序:
toggleIsReady最初设置为 false,但现在为 true。fetchLoansPromise- 无法获取它没有studentDataPromise获取studentDataPromise- 正确获取toggleIsReady- 现在设置为 falsefetchclassesPromise- 正确获取
有什么建议?