I am using react-query and have a lot of useQuery hooks that accept these parameters:
export interface UseQueryHookProps<K> {
client: K;
isEnabled?: boolean;
}
How would I write the interface to be more generic to accept any or rather unknown additional interface/s?
So something like this:
export interface UseQueryHookProps<K, T> extends T {
client: K;
isEnabled?: boolean;
}
Where UseQueryHookProps would be called:
export const useGetJob = ({
client: monitoringService,
isEnabled = true,
jobId,
}: UseQueryHookProps<MonitoringServiceClient, {jobId: string}>)
I am not sure how to write this?