function useFeedCache
useFeedCache<T>(
key: string,
hydrateItem: (raw: T) => T
): UseFeedCacheResult<T>

Returns the feed saved under key and a way to save it. The feed pages and useUserDumpFeed use it. key must tell apart every list whose items differ; the viewer is added to it here, since they see their own private items. hydrateItem restores what JSON lost, such as dates. A full or blocked storage is ignored.

Type Parameters

Parameters

key: string
hydrateItem: (raw: T) => T

Return Type

Usage

import { useFeedCache } from "src/hooks/feed/useFeedCache.ts";