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
Repeating this for every type of CRUD mutation feels ineffective. Is there a better approach?
Additionally, is there a material difference between the above and something that doesn't use MutationObserver, but instead is just a promise with a try/catch that interacts with the query cache:
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I am experimenting with using
react-query
in an unconventional manner, where it's used outside a react context.This is a WIP TodoMVC written with react query and XState: https://codesandbox.io/s/xstate-react-query-s9kxb?file=/src/todosMachine.ts
One thing that I ended up doing is writng a lot of code like this for the different mutations (edit, create, delete, etc...):
Repeating this for every type of CRUD mutation feels ineffective. Is there a better approach?
Additionally, is there a material difference between the above and something that doesn't use
MutationObserver
, but instead is just a promise with a try/catch that interacts with the query cache:Beta Was this translation helpful? Give feedback.
All reactions