When I was young, I was thrilled to discover I could cancel HTTP requests using cancelToken
. However, it took me a month to realize that this didn't actually help reduce server load. These days, developers are quite enthusiastic about AbortController
and AbortSignal
. Some influential developers discovered that AbortController
could be used not just for cancelling fetch
requests, but for nearly any event. Soon after, social media became filled with articles about AbortController
- to the point where not writing about it seemed to suggest you weren't a proper frontend developer.
I agreed that these features are great and fun, but as a developer, we should not only know what is it, but also know how it works.
Let's start from the basic use case: cancel a fetch
request.