-
To cancel an ongoing
fetch
request. -
Create a controller:
const controller = new AbortController()
. -
When
abort()
is called,controller.signal
emits the "abort" event, and thecontroller.signlar.aborted
property becomes true. -
You would pass
controller.signal
as an option to fetch (signal option) -
To abort you would call
controller.abort()
to cancel the request. -
An error will be thrown with the name
AbortError
. -
Also scalable, you can abort multiple fetches at the same time if they use the same signal.
-
Notifications
You must be signed in to change notification settings - Fork 0
tigerabrodi/abort-controller
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Notes about Abort Controller, cancel ongoing request.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published