UseCacheOptionsType
Import
import { UseCacheOptionsType } from "@hyper-fetch/react"
Source
Package
Preview
type UseCacheOptionsType<T,TSelected> = {
deepCompare?: boolean | typeof isEqual;
dependencyTracking?: boolean;
initialResponse?: CacheValueType<ExtractResponseType<T>, ExtractErrorType<T>>[data] | null;
select?: UseTrackedStateSelect<T, TSelected>;
structuralSharing?: boolean;
}
Structure
UseCacheOptionsType
| Name | Type | Description |
|---|---|---|
| deepCompare | | Deep comparison function for hook to check for equality in incoming data, to limit rerenders. |
| dependencyTracking | | If
|
| initialResponse | | If cache is empty we can use placeholder data. |
| structuralSharing | | Keep references of the unchanged parts of the selected data between updates (default true). |
| select | | Pick or transform the part of the cached data used by the component. The hook rerenders only when the selected value changes, while the cache stays shared with other hooks. |

