chore: follow the general comments style
This commit is contained in:
@@ -41,10 +41,14 @@ export class ApiError extends Error {
|
||||
* @param response - Original fetch Response object
|
||||
*/
|
||||
constructor(
|
||||
/** HTTP status code */
|
||||
/**
|
||||
* HTTP status code
|
||||
*/
|
||||
public status: number,
|
||||
message: string,
|
||||
/** Original Response object for inspection */
|
||||
/**
|
||||
* Original Response object for inspection
|
||||
*/
|
||||
public response?: Response,
|
||||
) {
|
||||
super(message);
|
||||
|
||||
@@ -15,15 +15,25 @@ import { QueryClient } from '@tanstack/query-core';
|
||||
export const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
/** Data remains fresh for 5 minutes after fetch */
|
||||
/**
|
||||
* Data remains fresh for 5 minutes after fetch
|
||||
*/
|
||||
staleTime: 5 * 60 * 1000,
|
||||
/** Unused cache entries are removed after 10 minutes */
|
||||
/**
|
||||
* Unused cache entries are removed after 10 minutes
|
||||
*/
|
||||
gcTime: 10 * 60 * 1000,
|
||||
/** Don't refetch when window regains focus */
|
||||
/**
|
||||
* Don't refetch when window regains focus
|
||||
*/
|
||||
refetchOnWindowFocus: false,
|
||||
/** Refetch on mount if data is stale */
|
||||
/**
|
||||
* Refetch on mount if data is stale
|
||||
*/
|
||||
refetchOnMount: true,
|
||||
/** Retry failed requests up to 3 times */
|
||||
/**
|
||||
* Retry failed requests up to 3 times
|
||||
*/
|
||||
retry: 3,
|
||||
/**
|
||||
* Exponential backoff for retries
|
||||
|
||||
@@ -3,21 +3,35 @@
|
||||
* Ensures consistent serialization for batch requests by sorting IDs.
|
||||
*/
|
||||
export const fontKeys = {
|
||||
/** Base key for all font queries */
|
||||
/**
|
||||
* Base key for all font queries
|
||||
*/
|
||||
all: ['fonts'] as const,
|
||||
|
||||
/** Keys for font list queries */
|
||||
/**
|
||||
* Keys for font list queries
|
||||
*/
|
||||
lists: () => [...fontKeys.all, 'list'] as const,
|
||||
/** Specific font list key with filter parameters */
|
||||
/**
|
||||
* Specific font list key with filter parameters
|
||||
*/
|
||||
list: (params: object) => [...fontKeys.lists(), params] as const,
|
||||
|
||||
/** Keys for font batch queries */
|
||||
/**
|
||||
* Keys for font batch queries
|
||||
*/
|
||||
batches: () => [...fontKeys.all, 'batch'] as const,
|
||||
/** Specific batch key, sorted for stability */
|
||||
/**
|
||||
* Specific batch key, sorted for stability
|
||||
*/
|
||||
batch: (ids: string[]) => [...fontKeys.batches(), [...ids].sort()] as const,
|
||||
|
||||
/** Keys for font detail queries */
|
||||
/**
|
||||
* Keys for font detail queries
|
||||
*/
|
||||
details: () => [...fontKeys.all, 'detail'] as const,
|
||||
/** Specific font detail key by ID */
|
||||
/**
|
||||
* Specific font detail key by ID
|
||||
*/
|
||||
detail: (id: string) => [...fontKeys.details(), id] as const,
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user