-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support background refresh #24
Comments
Hey, indeed, background loading and cancellation are patterns I've also had to implement a few times. A common approach could definitely speed things up, yet I don't have many opinions on what that should look like. At work we have a saying "PRs over issues", so just implement something, and that'll make it easier to discuss the next steps. Then, we could implement this directly into loaders, or make a separate As for other tips, personally I've always put the Good luck and hope this helps somewhat! Also apologies for the delay on my side. I'm happy to discuss this further, and with a smaller delay this time (I'm on 2 weeks of holiday now, so I finally got the time 😅) |
Awesome, thanks! I totally agree with PRs over issues (and usually create an issue and a PR at the same time in OSS repos so that I can reference one from the other), but I often have a hard time with that when I know so little about the intended direction of a project. Haha I appreciate the tips on how you've solved it and will dig deeper and see what I come up with. I'll create a rough solution and link the repo here so we can discuss. Something to think about in the meantime - would you want something this "core" to how we build for the web to live within the Have a great holiday! |
Being able to configure background refresh within loaders would be incredibly valuable. Currently, I'd need to add side-effects and manage them along with abort controllers on my own, but that should be a pretty standard pattern across each loader.
In thinking about how I would want to leverage this, I realized it may be nice to pass functions to an optional triggers property, which would then allow users to do things like avoid refreshes in idle states, explicitly refresh when a window gains focus or certain requests are made, etc.
I'm more than happy to tackle this, but I think it would be valuable to discuss what the ideal interface would be before really diving in.
The text was updated successfully, but these errors were encountered: