init
This commit is contained in:
11
src/store/global.tsx
Normal file
11
src/store/global.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
type GlobalState = {
|
||||
count: number;
|
||||
increment: () => void;
|
||||
};
|
||||
|
||||
export const useGlobalStore = create<GlobalState>((set) => ({
|
||||
count: 0,
|
||||
increment: () => set((state) => ({ count: state.count + 1 })),
|
||||
}));
|
||||
Reference in New Issue
Block a user