Type Alias: FetchInterceptors
FetchInterceptors =
object
Defined in: packages/fetch/src/types/interceptors.ts:219
All valid interceptors for fetch requests are:
- error
- request
- response
- result
An interceptor can be any of the following:
- synchronous function
- synchronous function that returns a promise (or sometimes returns a promise)
- asynchronous functions
An interceptor can return:
- undefined (void/no return): plain interceptor that does other stuff but does not transform
- value: act as a transformer. Returned value depends on the type of interceptor.
- promise resolves with (1) value or (2) undefined
PS:
- Any exception thrown by interceptors will gracefully ignored.
- Interceptors will be executed in the sequence they're given.
- Execution priority: global interceptors will always be executed before local interceptors.
- The following options cannot be modified using interceptors: abortCtrl, as, signal, timeout
More info about specific interceptor types & examples:
See the following for more details and examples:
error: FetchInterceptorErrorrequest: FetchInterceptorRequestresponse: FetchInterceptorResponseresult: FetchInterceptorResult
Properties
error?
optionalerror:FetchInterceptorError|FetchInterceptorError[]
Defined in: packages/fetch/src/types/interceptors.ts:221
Request error interceptors/transformers. See FetchInterceptorError for more details.
request?
optionalrequest:FetchInterceptorRequest|FetchInterceptorRequest[]
Defined in: packages/fetch/src/types/interceptors.ts:223
Request request interceptors/transformers. See FetchInterceptorRequest for more details.
response?
optionalresponse:FetchInterceptorResponse|FetchInterceptorResponse[]
Defined in: packages/fetch/src/types/interceptors.ts:225
Request response interceptors/transformers. See FetchInterceptorResponse for more details.
result?
optionalresult:FetchInterceptorResult|FetchInterceptorResult[]
Defined in: packages/fetch/src/types/interceptors.ts:227
Request result interceptors/transformers. See FetchInterceptorResult for more details.