You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently mutateAsync works differently than mutate in more ways than just "can be awaited".
currently mutateAsync will throw when an error is happening, however mutate will never throw.
basically there is no api for mutate and await till isPending is false without throwing errors.
I think mutateAsync has a ill defined name because of that, it should be more like resultAsync or something and mutateAsync should never throw and always return Promise<void> (success) so that one can await the mutation completly without try/catch.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
currently
mutateAsyncworks differently thanmutatein more ways than just "can be awaited".currently
mutateAsyncwill throw when an error is happening, however mutate will never throw.basically there is no api for
mutateandawaittillisPendingisfalsewithout throwing errors.I think
mutateAsynchas a ill defined name because of that, it should be more likeresultAsyncor something andmutateAsyncshould never throw and always returnPromise<void>(success) so that one canawaitthe mutation completly withouttry/catch.Beta Was this translation helpful? Give feedback.
All reactions