useMutation: enabled
prop
#5922
-
I'm making a mobile app with tan stack query, yeah, I'm exist. Steps:
First I want to stop some mutations until the application gets the token, and only then execute them. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think this may be a solution to the problem: watch(
queryClient.isRestoring,
async (isRestoring) => {
if (!isRestoring) {
// Wait auth....
console.log('Waiting auth for resume paused mutations...')
await until(isAuthenticated).toBe(true)
queryClient.resumePausedMutations()
console.log('Resume', queryClient)
}
},
{ immediate: true }
) |
Beta Was this translation helpful? Give feedback.
-
@bazuka5801 Hi!,
codes from example |
Beta Was this translation helpful? Give feedback.
I think this may be a solution to the problem: