Skip to content

Commit

Permalink
allow for global responseHandler and validateStatus configuration
Browse files Browse the repository at this point in the history
Wed Oct 26 06:39:23 UTC 2022
  • Loading branch information
phryneas committed Oct 26, 2022
1 parent 82cf232 commit efd1e35
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/toolkit/src/query/fetchBaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export interface FetchArgs extends CustomRequestInit {
body?: any
responseHandler?: ResponseHandler
validateStatus?: (response: Response, body: any) => boolean
/**
* A number in milliseconds that represents that maximum time a request can take before timing out.
*/
timeout?: number
}

Expand Down Expand Up @@ -129,11 +132,8 @@ export type FetchBaseQueryArgs = {
* Defaults to `application/json`;
*/
jsonContentType?: string
/**
* A number in milliseconds that represents that maximum time a request can take before timing out.
*/
timeout?: number
} & RequestInit
} & RequestInit &
Pick<FetchArgs, 'responseHandler' | 'validateStatus' | 'timeout'>

export type FetchBaseQueryMeta = { request: Request; response?: Response }

Expand Down

0 comments on commit efd1e35

Please sign in to comment.