Skip to main content

Variable: reviewKeys

const reviewKeys: object

Defined in: web/lib/hooks/use-review.ts:65

Query key factory for review queries.

Type declaration

all

all: readonly ["reviews"]

Base key for all review queries

byUser()

byUser: (did) => readonly ["reviews", "user", string]

Key for reviews by user

Parameters

did

string

Returns

readonly ["reviews", "user", string]

forPreprint()

forPreprint: (preprintUri) => readonly ["reviews", "preprint", string]

Key for reviews by preprint

Parameters

preprintUri

string

Returns

readonly ["reviews", "preprint", string]

inline()

inline: (preprintUri) => readonly ["reviews", "preprint", string, "inline"]

Key for inline reviews (span annotations)

Parameters

preprintUri

string

Returns

readonly ["reviews", "preprint", string, "inline"]

list()

list: (preprintUri, params?) => readonly ["reviews", "preprint", string, "list", undefined | ReviewListParams]

Key for reviews list with filters

Parameters

preprintUri

string

params?

ReviewListParams

Returns

readonly ["reviews", "preprint", string, "list", undefined | ReviewListParams]

thread()

thread: (reviewUri) => readonly ["reviews", "thread", string]

Key for specific review thread

Parameters

reviewUri

string

Returns

readonly ["reviews", "thread", string]

threads()

threads: () => readonly ["reviews", "thread"]

Key for review thread queries

Returns

readonly ["reviews", "thread"]

Remarks

Follows TanStack Query best practices for hierarchical cache key management. Enables fine-grained cache invalidation for review data.

Example

// Invalidate all review queries
queryClient.invalidateQueries({ queryKey: reviewKeys.all });

// Invalidate reviews for a specific preprint
queryClient.invalidateQueries({ queryKey: reviewKeys.forPreprint(preprintUri) });

// Invalidate a specific review thread
queryClient.invalidateQueries({ queryKey: reviewKeys.thread(reviewUri) });