This commit is contained in:
2025-03-20 18:06:22 +08:00
parent 9ad083b014
commit a2ef989b75
4 changed files with 71 additions and 1 deletions

18
stores/counterStore.ts Normal file
View File

@@ -0,0 +1,18 @@
// stores/counterStore.ts
import { makeAutoObservable } from "mobx";
export class CounterStore {
count = 0;
constructor() {
makeAutoObservable(this);
}
increment() {
this.count += 1;
}
decrement() {
this.count -= 1;
}
}