Is it possible to have a minimum loading time for useMutation hook? #5428
-
I am using the
Problem is sometimes, the mutation takes time, which is fine but other times, it happens quickly, so the loading indicators I have setup using the Is that possible without relying on |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
to avoid a flashing loading indicator, I ended up using a hook for that. const { isLoading: isLoadingOG, ...rest } = useMutation(/* .... */)
const isLoading = useThrottle(isLoadingOG, 500); // <---- like so. |
Beta Was this translation helpful? Give feedback.
to avoid a flashing loading indicator, I ended up using a hook for that.
You can find it here: https://usehooks.com/usethrottle