logDebug(`♻️ Refreshing data for collection ${queryKey.join(",")}`);
const response = await githubClient.conditionalRequest(apiCall, apiParams)
// Indicates no changes to the API, so we should return the existing data to indicate no changes.
if (!response) {
logDebug(`👎 No changes detected for collection ${queryKey.join(",")}`);
return client.getQueryData<TSelected[]>(queryKey) ?? [] as TSelected[];
}
// If the response is a single object, return it as an array
logDebug(`✨ Changes detected for collection ${queryKey.join(",")}`);
const result = selector(response);
return result
logDebug(`♻️ Refreshing data for collection ${queryKey.join(",")}`);
const response = await githubClient.conditionalRequest(apiCall, apiParams)
// Indicates no changes to the API, so we should return the existing data to indicate no changes.
if (!response) {
logDebug(`👎 No changes detected for collection ${queryKey.join(",")}`);
return client.getQueryData<TSelected[]>(queryKey) ?? [] as TSelected[];
}
// If the response is a single object, return it as an array
logDebug(`✨ Changes detected for collection ${queryKey.join(",")}`);
const result = selector(response);
return result