You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the arguments for the generated hooks had a default value if all the properties of the argument can be undefined.
Example of generated hook as is:
exportconstuseCatsServiceGetCats=<TData=CatServiceGetCatsDefaultResponse,TError=unknown,TQueryKeyextendsArray<unknown>=unknown[]>({
color,
age,}: {color?: string;age?: number;},queryKey?: TQueryKey,options?: Omit<UseQueryOptions<TData,TError>,"queryKey"|"queryFn"|"initialData">)=>useQuery<TData,TError>({queryKey: [useCatsServiceGetCatssKey,
...(queryKey??[{ color, age }]),],queryFn: ()=>CatsService.getCats(color,age)asTData,
...options,});// usage - need to pass empty object at leastconst{data}=useCatsServiceGetCats({});
Example of proposed generated code:
exportconstuseCatsServiceGetCats=<TData=CatServiceGetCatsDefaultResponse,TError=unknown,TQueryKeyextendsArray<unknown>=unknown[]>({
color,
age,}: {color?: string;age?: number;}={},// this is defaulted since all properties can be undefinedqueryKey?: TQueryKey,options?: Omit<UseQueryOptions<TData,TError>,"queryKey"|"queryFn"|"initialData">)=>useQuery<TData,TError>({queryKey: [useCatsServiceGetCatssKey,
...(queryKey??[{ color, age }]),],queryFn: ()=>CatsService.getCats(color,age)asTData,
...options,});// usage - no need to pass empty objectconst{data}=useCatsServiceGetCats();
The text was updated successfully, but these errors were encountered:
It would be nice if the arguments for the generated hooks had a default value if all the properties of the argument can be undefined.
Example of generated hook as is:
Example of proposed generated code:
The text was updated successfully, but these errors were encountered: