Skip to content

Commit

Permalink
perf(userAsyncEffect): exchange the order to judge the end of the asy…
Browse files Browse the repository at this point in the history
…ncGenerator
  • Loading branch information
hchlq committed May 8, 2022
1 parent ffbea63 commit a9f706e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hooks/src/useAsyncEffect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function useAsyncEffect(
if (isAsyncGenerator(e)) {
while (true) {
const result = await e.next();
if (cancelled || result.done) {
if (result.done || cancelled) {
break;
}
}
Expand Down

0 comments on commit a9f706e

Please sign in to comment.