Defines the interceptor for a Response. This allows you to intercept responses before unmarshalling.
Response
Adds a delay before sending the response:
const addDelayInterceptor: ResponseInterceptor = ({ response }) => new Promise(resolve => { setTimeout(() => resolve(response), 1000) }) Copy
const addDelayInterceptor: ResponseInterceptor = ({ response }) => new Promise(resolve => { setTimeout(() => resolve(response), 1000) })
Defines the interceptor for a
Response
. This allows you to intercept responses before unmarshalling.Example
Adds a delay before sending the response: