Mutation to tackle state update race conditions. Good or bad idea?
Hello. I want to update state with some async result and wondering if this approach is good?
If
I decided to
Is this something mutation can be used for?
If
updateConfig called multiple times race condition can happen.I decided to
useMutation, because it has one special feature - you can use onSuccess option in mutation.mutate method to ensure than only last called mutation onSuccess will be called as per documentation, so I can set state in this success call.Is this something mutation can be used for?