-
Mutaions have no key and it's also stated in TkDodo's blog that it's not shared:
Is there any encouraged pattern to get a mutation's result(success/failure) from elsewhere? I know we can leverage React and put the mutation into context or pass it as props. But I'm curious why you made the design decision not to have something like Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
mutations work differently from queries, because every mutation becomes a different observer once you execute and I do have some ideas on rewriting mutations completely to maybe make that happen :) if you only need the loading state of a mutation - |
Beta Was this translation helpful? Give feedback.
mutations work differently from queries, because every mutation becomes a different observer once you execute
mutate
. So even if we make the result sharable, it would likely only be the "latest" result. There is an open issue however:and I do have some ideas on rewriting mutations completely to maybe make that happen :)
if you only need the loading state of a mutation -
useIsMutating
can help