This commit is contained in:
rex
2025-10-23 16:31:00 +08:00
parent a5d7f6df0e
commit 8d63b1e80b
8 changed files with 88 additions and 87 deletions

View File

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