Flow of making Mutations Global across application #2446
Replies: 4 comments 1 reply
-
UseIsMutating is definitely made for that use case. You can narrow it down further by using a mutationKey. |
Beta Was this translation helpful? Give feedback.
-
If im reading the docs correctly useIsMutating will only return if the mutation is running... but i wont be able to know the staus etc.. like have access to the entire object.... so i will not be able to show a loader or success/failed message base on the mutation state. What im trynig to achive is to show the actual status of the mutation on a different compoenent. |
Beta Was this translation helpful? Give feedback.
-
Hey @cubecleveland, I have the same use case as you. What did you end up going with? |
Beta Was this translation helpful? Give feedback.
-
As suggested above lifting the state up... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have the following scenario.
I have mutations that are accesible form different components across the app. different buttons on different views are doing the same eaxct thing, I want to disable a button if the same mutation is being ran on a different view.
I know i shoud probably declare them globbaly and transfer them via context but i was wondering if there is another way to do it or if there is a recomneded flow of acieving this.
I tried usign useIsMutating to see if the the mutation is being run.. but i feel like im doing it wrong......
note: the mutations take time to post to server so its definetly a possibiility for the user to -- in the meantime-- route to another view and try the exact same mutation from another button.
Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions