abort
This commit is contained in:
parent
a9d21768d8
commit
30f1dc4e4e
1 changed files with 2 additions and 2 deletions
|
@ -13,9 +13,9 @@ The usage is pretty simple:
|
||||||
let controller = new AbortController();
|
let controller = new AbortController();
|
||||||
```
|
```
|
||||||
|
|
||||||
The controller is an extremely simple object. It has a single method `abort()`, and a single property `signal`, that generates an event when `abort()` is called:
|
A controller is an extremely simple object. It has a single method `abort()`, and a single property `signal`. When `abort()` is called, the `abort` event triggers on `controller.signal`:
|
||||||
|
|
||||||
We can even use it without `fetch` for our own purposes, like this:
|
Like this:
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
let controller = new AbortController();
|
let controller = new AbortController();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue