aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/atoms/feeds.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/atoms/feeds.ts')
-rw-r--r--frontend/src/atoms/feeds.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/frontend/src/atoms/feeds.ts b/frontend/src/atoms/feeds.ts
new file mode 100644
index 0000000..5c39735
--- /dev/null
+++ b/frontend/src/atoms/feeds.ts
@@ -0,0 +1,10 @@
+import { atomWithSuspenseQuery } from "jotai-tanstack-query";
+import { api } from "../services/api-client";
+
+export const feedsAtom = atomWithSuspenseQuery(() => ({
+ queryKey: ["feeds"],
+ queryFn: async () => {
+ const { data } = await api.GET("/api/feeds");
+ return data ?? [];
+ },
+}));