chore: add react-query

This commit is contained in:
2024-04-18 22:41:21 +02:00
parent 069a3deb7c
commit 21925d101e
7 changed files with 71 additions and 32 deletions

View File

@@ -0,0 +1,13 @@
import { useQuery } from "@tanstack/react-query";
import { podcastsService } from "./podcasts.service";
const QUERY_KEYS = {
TOP_PODCASTS: "podcasts/top",
} as const;
export function useTopPodcastsQuery() {
return useQuery({
queryKey: [QUERY_KEYS.TOP_PODCASTS],
queryFn: () => podcastsService.getTopPodcasts(),
});
}