refactor: Replace short hand type conversions with function calls

Prefer using explicit casts by calling `Number`, `Boolean`, or `String` over using operators like `+`, `!!` or `"" +`. This is considered best practice as it improves readability.
This commit is contained in:
deepsource-autofix[bot]
2023-03-27 06:10:26 +00:00
committed by GitHub
parent 964b65477c
commit 64e8e85aac
3 changed files with 3 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ const usePrepareGridstack = () => {
}, [width]); }, [width]);
return { return {
isReady: !!mainAreaWidth, isReady: Boolean(mainAreaWidth),
mainAreaRef, mainAreaRef,
}; };
}; };

View File

@@ -29,7 +29,7 @@ export const useGetUsenetInfo = (params: UsenetInfoRequestParams) =>
refetchInterval: POLLING_INTERVAL, refetchInterval: POLLING_INTERVAL,
keepPreviousData: true, keepPreviousData: true,
retry: 2, retry: 2,
enabled: !!params.appId, enabled: Boolean(params.appId),
} }
); );

View File

@@ -20,7 +20,7 @@ export const useWeatherForCity = (cityName: string) => {
const weatherQuery = useQuery({ const weatherQuery = useQuery({
queryKey: ['weather', { cityName }], queryKey: ['weather', { cityName }],
queryFn: () => fetchWeather(city?.results[0]), queryFn: () => fetchWeather(city?.results[0]),
enabled: !!city, enabled: Boolean(city),
cacheTime: 1000 * 60 * 60 * 6, // the weather is cached for 6 hours cacheTime: 1000 * 60 * 60 * 6, // the weather is cached for 6 hours
staleTime: 1000 * 60 * 5, // the weather is considered stale after 5 minutes staleTime: 1000 * 60 * 5, // the weather is considered stale after 5 minutes
}); });