mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
The five-thousand-line route registry splits into thirteen domain modules and the query-key factory into twelve feature files — each behind an index that preserves exact registration order, proven by a byte-identical generated contract. The factory lint rule learns the new home directory.
26 lines
996 B
TypeScript
26 lines
996 B
TypeScript
/**
|
|
* Query keys — workout list, recent strip, and detail caches.
|
|
* Part of the centralized factory; aggregated in `./index.ts`.
|
|
*/
|
|
export const workoutKeys = {
|
|
// v1.4.32 — workout list + detail caches. `workouts()` is the
|
|
// root key invalidated by the batch-ingest mutation; the recent +
|
|
// detail sub-keys ride underneath so the dashboard tile and the
|
|
// detail page share a cache slot with the list page.
|
|
workouts: () => ["workouts"] as const,
|
|
workoutsRecent: () => ["workouts", "recent"] as const,
|
|
/**
|
|
* v1.4.42 W3-QUERYKEY-LONGTAIL — the `useWorkouts` hook used to
|
|
* spread `workoutsRecent()` and append an opts object inline. The
|
|
* factory now owns the full shape so the hook never reaches for a
|
|
* literal-array wrapper.
|
|
*/
|
|
workoutsRecentList: (opts: {
|
|
limit?: number;
|
|
offset?: number;
|
|
since?: string;
|
|
sportType?: string;
|
|
}) => ["workouts", "recent", opts] as const,
|
|
workoutDetail: (id: string) => ["workouts", id] as const,
|
|
};
|