How to get global access to all mutations that are running?
I am making an app where offline support is critical. I have managed to get mutations to work for offline usage. One thing that I am missing is the ability to see the status of each mutation. to see if it fails, succeeds or is still loading. There will be a component where you are able to see all of requests and their respective status. Any tips for how to getting access to the data?
2 Replies
correct-apricot•3y ago
To me that’s just UI state data. I would create a “store” that keeps track of the mutation states. The mutations update their state in the store and subscribers to those changes can update their UI appropriately. useSyncExternalStore is handy here. This is all assuming I’m not using a state library like Zustand etc.
unwilling-turquoise•3y ago
We discussed this earlier here: https://discord.com/channels/719702312431386674/1003327027849474198/1065626200766169148