Skip to content

Commit

Permalink
chore: add zustand global stores
Browse files Browse the repository at this point in the history
  • Loading branch information
hyamero committed Aug 20, 2024
1 parent f5181af commit 2eff706
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/hooks/use-attendees-store.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Attendee } from "@/lib/types";
import { create } from "zustand";

type AttendeesState = {
parsedAttendees: Attendee[];
setParsedAttendees: (attendees: Attendee[]) => void;
};

export const useAttendeesStore = create<AttendeesState>()((set) => ({
parsedAttendees: [] as Attendee[],
setParsedAttendees: (attendees) =>
set(() => ({
parsedAttendees: attendees,
})),
}));
11 changes: 11 additions & 0 deletions src/hooks/use-dialog-store.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { create } from "zustand";

type DialogState = {
importDialog: boolean;
setImportDialog: (state: boolean) => void;
};

export const useDialogStore = create<DialogState>()((set) => ({
importDialog: false,
setImportDialog: (state) => set(() => ({ importDialog: state })),
}));

0 comments on commit 2eff706

Please sign in to comment.