Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: infinite loop when use revalidateWhenExecuted #170

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

hiroki0525
Copy link
Owner

@hiroki0525 hiroki0525 commented Dec 31, 2024

An infinite loop occurs when use revalidateWhenExecuted. This PR is to fix this.

// infinite loop
let counter = 0;
const maxCounter = 3;
const key = setIdleTask(
  () => {
    if (counter < maxCounter) {
      // not working
      cancelIdleTask(key);
    }
    counter++;
  },
  { revalidateWhenExecuted: true }
);

Copy link

bundlemon bot commented Dec 31, 2024

BundleMon

Files added (2)
Status Path Size Limits
index.cjs
+1.69KB -
index.js
+1.68KB -

Total files change +3.36KB

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

@hiroki0525 hiroki0525 merged commit 7eff9c6 into develop Dec 31, 2024
4 checks passed
@hiroki0525 hiroki0525 deleted the fix-infinite-loop branch December 31, 2024 08:36
@hiroki0525 hiroki0525 mentioned this pull request Dec 31, 2024
@hiroki0525
Copy link
Owner Author

🎉 This PR is included in version 4.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant