Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Dec 8, 2023
1 parent 976b1dd commit 719d1fc
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions website/src/pages/client/request-params.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,13 @@ cancel a request. Pass the `signal` property as the second argument to the reque
```ts filename="request-cancellation.ts"
const abortCtrl = new AbortController()

client['/add-pet'].post(
{
json: {
name: 'Cheddar',
description: 'Small cat with a big attitude'
}
client['/add-pet'].post({
json: {
name: 'Cheddar',
description: 'Small cat with a big attitude'
},
{
signal: abortCtrl.signal
}
)
signal: abortCtrl.signal
})

// Cancel the request
abortCtrl.abort()
Expand All @@ -118,15 +114,11 @@ You can use
cancel a request. Pass the `signal` property with `AbortSignal.timeout()` to the request:

```ts filename="request-timeout.ts"
client['/add-pet'].post(
{
json: {
name: 'Cheddar',
description: 'Small cat with a big attitude'
}
client['/add-pet'].post({
json: {
name: 'Cheddar',
description: 'Small cat with a big attitude'
},
{
signal: AbortSignal.timeout(5000)
}
)
signal: AbortSignal.timeout(5000)
})
```

0 comments on commit 719d1fc

Please sign in to comment.