Improve types

This commit is contained in:
Justin 2022-08-10 13:27:09 -04:00
parent 06d1ad2efe
commit 4d98046627

View file

@ -11,7 +11,7 @@ export default function useTrends() {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const getTrends = async() => { const getTrends = async() => {
const { data } = await api.get<Tag[]>('/api/v1/trends'); const { data } = await api.get<any[]>('/api/v1/trends');
dispatch(fetchTrendsSuccess(data)); dispatch(fetchTrendsSuccess(data));
@ -19,10 +19,10 @@ export default function useTrends() {
return normalizedData; return normalizedData;
}; };
const result = useQuery<Tag[]>(['trends'], getTrends, { const result = useQuery<ReadonlyArray<Tag>>(['trends'], getTrends, {
placeholderData: [], placeholderData: [],
staleTime: 600000, // 10 minutes staleTime: 600000, // 10 minutes
}); });
return result; return result;
} }