Skip to main content

Variable: trendingKeys

const trendingKeys: 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

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 as part of the key for separate caching per window.

Example

// Invalidate all trending queries
queryClient.invalidateQueries({ queryKey: trendingKeys.all });

// Invalidate specific window
queryClient.invalidateQueries({ queryKey: trendingKeys.window('7d') });