Skip to content

Commit 4880369

Browse files
committed
📝 Update options description
1 parent c2c6fa2 commit 4880369

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/index.ts

+7-11
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,18 @@ interface RequiredOptions<P extends Payload> extends RequestInit {
4747
*/
4848
json?: P['json']
4949
/**
50-
* Search params to append to the request URL.
51-
* Provide an `object`, `string`, or `URLSearchParams` instance.
50+
* Search params to append to a request URL.
5251
*/
5352
params?: P['params']
5453
/**
55-
* Custom search params serializer when `object` is used.
54+
* Custom search params serializer when `object` passed to `params`.
5655
* Defaults to internal implementation based on `URLSearchParams`
5756
* with better handling of array values.
5857
*/
5958
serialize?: Serialize
6059
/**
61-
* If specified `TimeoutError` will be thrown and
62-
* the request will be cancelled after the specified duration.
60+
* If specified `TimeoutError` will be thrown and the request will be
61+
* cancelled after a specified duration.
6362
*/
6463
timeout?: number
6564
/**
@@ -68,8 +67,7 @@ interface RequiredOptions<P extends Payload> extends RequestInit {
6867
*/
6968
highWaterMark?: number
7069
/**
71-
* Request handler.
72-
* Use the callback to modify options before the request
70+
* Use the callback to modify options before a request
7371
*/
7472
onRequest(url: URL, options: RequestOptions<P>): Promise<void> | void
7573
/**
@@ -78,13 +76,11 @@ interface RequiredOptions<P extends Payload> extends RequestInit {
7876
onResponse(response: Response<P>): Promise<Response<P>> | Response<P>
7977
/**
8078
* Success response handler (usually codes 200-299).
81-
* @see onResponse
8279
*/
8380
onSuccess?(response: Response<P>): Promise<Response<P>> | Response<P>
8481
/**
85-
* Error handler.
86-
* Throw custom error, or return a new `Promise` with `Response` using `request`.
87-
* @see onResponse
82+
* Instance error handler. Use it to throw custom errors
83+
* or to send information to error tracking service.
8884
*/
8985
onFailure?(
9086
error: ResponseError<P> | TimeoutError | Error

0 commit comments

Comments
 (0)