From b2e9c1f056b70ee0bd853c736e44ba3775d1c5e1 Mon Sep 17 00:00:00 2001 From: Arif Hasanic Date: Fri, 25 Jul 2025 01:19:05 +0200 Subject: [PATCH] name the stores --- src/store/flatastic.ts | 7 +++++-- src/store/kvv.ts | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/store/flatastic.ts b/src/store/flatastic.ts index 2af7ea8..2d9d6d2 100644 --- a/src/store/flatastic.ts +++ b/src/store/flatastic.ts @@ -1,14 +1,15 @@ import { create } from "zustand"; import Flatastic from "@/api/flatastic"; import type { FlatasticChore } from "@/types/flatasticChore"; +import { devtools } from "zustand/middleware"; interface FlatasticStore { chores: FlatasticChore[]; fetch: () => Promise; } -const useFlatasticStore = create( - (set: (state: Partial) => void) => ({ +const useFlatasticStore = create( + devtools((set) => ({ chores: [], fetch: async () => { if (!import.meta.env.VITE_FLATTASTIC_API_KEY) { @@ -20,6 +21,8 @@ const useFlatasticStore = create( console.log("Flatastic chores fetched:", data); set({ chores: data as FlatasticChore[] }); }, + }), { + name: "flatastic-store", }), ); diff --git a/src/store/kvv.ts b/src/store/kvv.ts index 96c04b7..003547a 100644 --- a/src/store/kvv.ts +++ b/src/store/kvv.ts @@ -25,7 +25,9 @@ const useKVVStore = create( pStreet: pStreetJson as DepartureType[], }); }, - })), + }), { + name: "kvv-store", + }), ); export { useKVVStore };