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

[Request] Guide on how to optimize for optimistic updates #252

Open
jeroenptrs opened this issue Sep 21, 2024 · 0 comments
Open

[Request] Guide on how to optimize for optimistic updates #252

jeroenptrs opened this issue Sep 21, 2024 · 0 comments

Comments

@jeroenptrs
Copy link

jeroenptrs commented Sep 21, 2024

Hi all! I'm having fun writing a project with this, but I'm struggling with a key thing. I would like to have my React Native app be local first, as occasionally I'm in areas where I do not have any network or spotty network at best and I would like my changes to be persisted locally first.

I've thought of multiple approaches and - because it's my first time using Instant - I'm also well aware I might not be doing things correctly. Which is why I'm hoping on some insights and guidance from y'all that might benefit any Instant user in how to tackle ensuring updates are optimistic and local first.

For context my project specifically appears to struggle when separating queries into hooks, and it relies on entries being ordered as well.
I know there's a separate issue for custom ordered queries so currently I stick to order: { serverCreatedAt: 'desc' } but that also appears to be quite expensive and not very optimistic especially when there is a working network connection. Do I just fetch all and write a filter myself, or have a {archived, completed, ...} property in there somewhere (which in my experience also impacted a mutation's optimistic-ness).

All in all I'm hoping to learn from y'all how to best write my applications using Instant 🙏

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

No branches or pull requests

1 participant