Skip to content

Commit

Permalink
chore: clean up comments around react query code
Browse files Browse the repository at this point in the history
  • Loading branch information
ndv99 committed Jan 20, 2025
1 parent c64d165 commit 57c44b9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/app/api/query-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,19 @@ type QueryKeySubcategories<T extends QueryKeyCategories> = keyof QueryKeys[T];
export type QueryKey =
QueryKeys[QueryKeyCategories][QueryKeySubcategories<QueryKeyCategories>];

// first element of the queryKeys array
// Idk what Peter meant by the above comment, but QueryModel is basically QueryKey but not in an array from what I understand.
export type QueryModel = QueryKey[number];

// 5 minutes feels rather long for default stale time.
export const defaultQueryOptions = {
staleTime: 5 * 60 * 1000, // 5 minutes
cacheTime: 15 * 60 * 1000, // 15 minutes
refetchOnWindowFocus: true,
} as const;

// 0 is far too quick lol but at least we're not using this.
export const realTimeQueryOptions = {
staleTime: 0,
cacheTime: 60 * 1000, // 1 minute
} as const;

// This just creates a query client and provides the options specified above.
export const createQueryClient = () =>
new QueryClient({
defaultOptions: {
Expand Down

0 comments on commit 57c44b9

Please sign in to comment.