You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let results =awaitPromise.all([...fetchJobs, ourJob]);
139
139
140
-
// if controller.abort() is called from elsewhere,
140
+
// if controller.abort() is called from anywhere,
141
141
// it aborts all fetches and ourJob
142
142
```
143
143
144
144
## Summary
145
145
146
-
-`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`).
147
-
-`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`.
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`).
147
+
-`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`.
148
148
- 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