Anyway to track pending state per mutation?
hello everybody im working on a live search feature where im running a mutation getting back some data manually entering it into a querycache using setQueryData setting querydefaults for staletime and gcTime
now the issue is i have a toggle system for time! so im getting live search results for "today" / "week"
when i toggle from today -> week it triggers a new mutation and shows the loading spinner while its pending but when i switch back to today from "week" it still shows the spinner for isPending for the "week" mutation when my desired behavior is to show the cached data i got back for "today" while the "week" mutation continues on!
heres some code ive got
heres my handle time change function to trigger the mutation when time changes but when i flip back and cache exists for previous one and the other mutation is still running i want it to show the old data
how can i achieve that?
now the issue is i have a toggle system for time! so im getting live search results for "today" / "week"
when i toggle from today -> week it triggers a new mutation and shows the loading spinner while its pending but when i switch back to today from "week" it still shows the spinner for isPending for the "week" mutation when my desired behavior is to show the cached data i got back for "today" while the "week" mutation continues on!
heres some code ive got
heres my handle time change function to trigger the mutation when time changes but when i flip back and cache exists for previous one and the other mutation is still running i want it to show the old data
how can i achieve that?