Proper way to handle server actions on client side.
Unanswered
Brown bear posted this in #help-forum
Brown bearOP
Normally, we send in AbortController to fetch, so it can be cancelled when in Dev mode double calls or when user navigate away from the current page while it is still fetching.
However, there is no way to handle this if we use server actions on the client side?
However, there is no way to handle this if we use server actions on the client side?
3 Replies
@Brown bear Normally, we send in AbortController to fetch, so it can be cancelled when in Dev mode double calls or when user navigate away from the current page while it is still fetching.
However, there is no way to handle this if we use server actions on the client side?
Knopper gall
It's handled automatically.
Any server actions pending are dropped if the user navigates away
Any server actions pending are dropped if the user navigates away
Brown bearOP
How about the double call in dev mode useEffect?
@Brown bear How about the double call in dev mode useEffect?
Knopper gall
What about it?