Best way to execute side-effects based on query's result? #8931
-
Hello, I hope everyone is doing fine! I have a page in my app that has a query running endlessly checking for the approval status on an item, once the item is approved or rejected I have to navigate to another page, and if it's rejected I must remove it from the zustand store. So basically what I'm asking is what is considered to be the best way to execute a function after a query has run? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
navigation can be done declaratively in most routing libraries:
Not sure why the item is in the zustand store, but you can do that either from within the queryFn or in an effect. |
Beta Was this translation helpful? Give feedback.
navigation can be done declaratively in most routing libraries:
Not sure why the item is in the zustand store, but you can do that either from within the queryFn or in an effect.