Skip to content

Commit 9636657

Browse files
committed
update: readme abort controller
1 parent 5fcc751 commit 9636657

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,25 @@ const response = await client.getList({
312312
});
313313
```
314314
315+
### AbortController: abort() method
316+
317+
You can abort fetch requests.
318+
319+
```ts
320+
const controller = new AbortController()
321+
const response = await client.getObject({
322+
customRequestInit: {
323+
signal: controller.signal
324+
},
325+
endpoint: "config",
326+
});
327+
328+
setTimeout(() => {
329+
controller.abort()
330+
}, 1000)
331+
```
332+
333+
315334
# LICENSE
316335
317336
Apache-2.0

0 commit comments

Comments
 (0)