18 lines
224 B
TypeScript
18 lines
224 B
TypeScript
import { makeAutoObservable } from "mobx";
|
|
|
|
export class CounterStore {
|
|
count = 0;
|
|
|
|
constructor() {
|
|
makeAutoObservable(this);
|
|
}
|
|
|
|
increment() {
|
|
this.count += 1;
|
|
}
|
|
|
|
decrement() {
|
|
this.count -= 1;
|
|
}
|
|
}
|