Skip to content

Commit ea35ef2

Browse files
authored
Merge pull request #369 from odsantos/update-en-fetch-abort
Update "Fetch: Abort" article
2 parents 5d86a91 + ad0abcf commit ea35ef2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

5-network/04-fetch-abort/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ When `abort()` is called:
2424
- `controller.signal` emits the `"abort"` event.
2525
- `controller.signal.aborted` property becomes `true`.
2626

27-
Generally, we have two parties in the process:
27+
Generally, we have two parties in the process:
2828
1. The one that performs a cancelable operation, it sets a listener on `controller.signal`.
2929
2. The one that cancels: it calls `controller.abort()` when needed.
3030

@@ -34,7 +34,7 @@ Here's the full example (without `fetch` yet):
3434
let controller = new AbortController();
3535
let signal = controller.signal;
3636

37-
// The party that performs a cancelable operation
37+
// The party that performs a cancelable operation
3838
// gets the "signal" object
3939
// and sets the listener to trigger when controller.abort() is called
4040
signal.addEventListener('abort', () => alert("abort!"));
@@ -143,6 +143,6 @@ let results = await Promise.all([...fetchJobs, ourJob]);
143143

144144
## Summary
145145

146-
- `AbortController` is a simple object that generates an `abort` event on it's `signal` property when the `abort()` method is called (and also sets `signal.aborted` to `true`).
146+
- `AbortController` is a simple object that generates an `abort` event on its `signal` property when the `abort()` method is called (and also sets `signal.aborted` to `true`).
147147
- `fetch` integrates with it: we pass the `signal` property as the option, and then `fetch` listens to it, so it's possible to abort the `fetch`.
148148
- 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`.

0 commit comments

Comments
 (0)