Abort Fetch
How to control Fetch
AbortController
AbortController is a web API that allows to abort one or more web requests as and when desired.
signal
Returns an AbortSignal object instance, which can be used to communicate with, or to abort, a DOM request.
abort()
Aborts a DOM request before it has completed. This is able to abort fetch requests, consumption of any response bodies, and streams.
If fetch lasts more than 2 seconds, it will abort fetch.
After ten seconds, it will show an error that the fetch is rejected, but it will not abort other fetches; it will show a result after the fetch succeeds.