eon-lee
Results
1
comments of
eon-lee
https://github.com/alibaba/hooks/blob/d5fd82c5886d781ef12d8ff176ed9d03038e089b/packages/hooks/src/useRequest/src/Fetch.ts#L83 假设`servicePromise`是一个异步3秒的函数,3秒内暴击触发3次 `runAsync` ,因为是在异步后访问 `this.count`,3次拿到的值都会是3,这就导致会有一次的 `runAsync` 走进 https://github.com/alibaba/hooks/blob/d5fd82c5886d781ef12d8ff176ed9d03038e089b/packages/hooks/src/useRequest/src/Fetch.ts#L85 而这个`Promise`没有 `resolve`,所以永远 `pending`。是不是可以考虑在这里直接 `Promise.resolve(res)`