Variable: trendingKeys
consttrendingKeys:object
Defined in: web/lib/hooks/use-trending.ts:23
Query key factory for trending queries.
Type declaration
all
all: readonly [
"trending"]
Base key for all trending queries
personalized()
personalized: (
window,fieldUris) => readonly ["trending","24h"|"7d"|"30d","fields",string]
Key for trending query with time window and field URIs
Parameters
window
"24h" | "7d" | "30d"
fieldUris
string[]
Returns
readonly ["trending", "24h" | "7d" | "30d", "fields", string]
window()
window: (
window) => readonly ["trending","24h"|"7d"|"30d"]
Key for trending query with specific time window
Parameters
window
"24h" | "7d" | "30d"
Returns
readonly ["trending", "24h" | "7d" | "30d"]
Remarks
Follows TanStack Query best practices for cache key management. Uses the time window and field URIs as part of the key for separate caching.
Example
// Invalidate all trending queries
queryClient.invalidateQueries({ queryKey: trendingKeys.all });
// Invalidate specific window
queryClient.invalidateQueries({ queryKey: trendingKeys.window('7d') });