Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean up comments around react query code #5584

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading