Cancelling an Axios request in a useEffect hook

preview_player
Показать описание
This video shows how to cancel an Axios request before it completes. We'll use a useEffect hook and it's cleanup function to help us accomplish this.

Рекомендации по теме
Комментарии
Автор

Thanks man, I only need to watch the first 5 seconds of your video to do what I needed, thanks for getting straight to the point.

MierdesTaker
Автор

Just stumbled upon this video. You're an excellent teacher! Easy to follow and simple. Thanks

wixnarara
Автор

Thank you so much Leigh for making this video! Keep doing great job bud.

dominikseljan
Автор

Thanks for this, man. Helped me solve an issue that was causing a lot of headache

lova
Автор

FYI
I'm not sure if you noticed, but the cancelled request status is not only marked cancelled, but the color of the entire entry is also changed to red.
Years ago I filed a feature request in Firebug to change the color of cancelled requests to red and now all dev tools use it :)

les
Автор

Beautiful I think I know all about canceling with useEffect now, its used for removing state Updates and attached event handlers that the component deals with when it gets detached in the state of execution of the useEffect, very nice explanation sir

lookintomyeyes
Автор

Thank you! this was very clear and straight to the point!

neenus
Автор

Love the videos Leigh! Thank you so much for teaching us!!!

FrankHale
Автор

very helpful and clean explanation . Thank you very much!

cicerotcv
Автор

You got me subscribed !! Such an amazing explanation and perfect way to deal with it !!!

MrFamboYT
Автор

Thank you maestro, you are a great teacher and you pick great topics!

oskarhulter
Автор

This was new to me and you explained it very well, thank you :)

adiriphone
Автор

Exactly what I was looking for. Thanks.

flagoon
Автор

Thanks a lot!!! Amazing job you do, it comes so clear

reda_el
Автор

great explanation on a tricky topic! thanks for the video

julianjacobs
Автор

Thanks brother 🙌
Very helpful video 🤘

rajatparab
Автор

thanks for sharing your expertise, helps a lot 👍

herberthsu
Автор

Hello Leigh, Is there any option available to cancel my previous api call from Backend? Like I triggered a button to call an api but suddenly I need to stop that request by clicking another button and that operation will be cancelled from backend

rezaulmasum
Автор

thanks for the video, i have question: do the backend is abort the process immediately? or the frontend just dont care about the response from backend

raero
Автор

I'm working with a poject which the user can make a post with an image/video or audio file, or a post with only "text", i made that solution, it cancel the posting request, however the text is been created, and database create an instance of the post with only "text", do i have to handle the cancellation in server side too ! ?

Khartstudio