mirror of
https://github.com/ershisan99/podcaster.git
synced 2026-01-21 21:02:07 +00:00
chore: add react-query
This commit is contained in:
13
src/services/podcasts/podcast.hooks.ts
Normal file
13
src/services/podcasts/podcast.hooks.ts
Normal 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(),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user