getCacheData
Import
import { getCacheData } from "@hyper-fetch/core"
Source
Package
Parameters
getCacheData<T>(previousResponse: undefined | ExtractAdapterResolvedType<T>, response: ExtractAdapterResolvedType<T> & ResponseDetailsType)
Parameters
| Name | Type | Description |
|---|---|---|
| previousResponse | | |
| response | |
Returns
getCacheData
| Name | Type | Description |
|---|---|---|
| data | | Response data when successful, null on error |
| error | | Error payload when the request fails, null on success |
| extra | | Adapter-specific metadata (e.g., response headers) |
| requestTimestamp | | Timestamp (ms) when the request was sent |
| responseTimestamp | | Timestamp (ms) when the response was received |
| status | | HTTP status code or adapter-specific status indicator |
| success | | Whether the request completed successfully |
| addedTimestamp | | When added to dispatcher's queue (pre-middleware which could take time) |
| isCanceled | | If request was canceled |
| isOffline | | If error from offline status |
| requestTimestamp | | When adapter triggers request (after all middlewares) |
| responseTimestamp | | When we receive response |
| retries | | If it's retry request we can see which attempt is it |
| triggerTimestamp | | When request is picked from queue and started to be sent |
| willRetry | | Whether the dispatcher will schedule another retry for this request |
