This commit is contained in:
rex
2025-09-01 20:01:21 +08:00
parent 8dd468a5e3
commit 272c87f799
20 changed files with 150 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
import { create } from "zustand";
import { create } from 'zustand';
type GlobalState = {
count: number;
@@ -7,5 +7,8 @@ type GlobalState = {
export const useGlobalStore = create<GlobalState>((set) => ({
count: 0,
increment: () => set((state) => ({ count: state.count + 1 })),
increment: () => {
console.log('increment');
set((state) => ({ count: state.count + 1 }));
},
}));