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

atomWithSuspenseQuery keeps executing the queryFn if you use it in a derived atom with some try/catch logic #96

Open
sunniejai opened this issue Nov 14, 2024 · 0 comments

Comments

@sunniejai
Copy link

sunniejai commented Nov 14, 2024

Im running into an issue with jotai-tanstack-query and jotai where if I have a derived atom that has some try/catch logic around a atomWithSuspenseQuery that throws an error, the queryFn will just keep executing. I'm assuming this is a bug?

simple repro here: https://codesandbox.io/p/sandbox/practical-kare-wlfm83

the use case for me is I wanted to add some handling for returning some default fallback in the derived atom when i get a 404, but im running into an issue where it executes more than it needs to

@sunniejai sunniejai changed the title atomWithSuspenseQuery keeps executing the queryFn when you throw an exception atomWithSuspenseQuery keeps executing the queryFn if you use it in a derived atom with some try/catch logic Nov 14, 2024
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