One more step please

This commit is contained in:
joaquinelio 2020-09-22 15:03:47 -03:00 committed by GitHub
parent e7f6a8804c
commit 8a330b3973
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ The usage is very straightforward:
## The AbortController object
Step 1: create a controller:
Create a controller:
```js
let controller = new AbortController();
@ -145,4 +145,4 @@ let results = await Promise.all([...fetchJobs, ourJob]);
- `AbortController` is a simple object that generates `abort` event on it's `signal` property when `abort()` method is called (and also sets `signal.aborted` to `true`).
- `fetch` integrates with it: we pass `signal` property as the option, and then `fetch` listens to it, so it becomes possible to abort the `fetch`.
- We can use `AbortController` in our code. The "call `abort()`" -> "listen to `abort` event" interaction is simple and universal. We can use it even without `fetch`.
- We can use `AbortController` in our code. The "call `abort()`" -> "listen to `abort` event" interaction is simple and universal. We can use it even without `fetch`.