import {action, makeObservable, observable} from "mobx"; import {RootStore} from "./RootStore"; export class ThinkStore { rootStore: RootStore; @observable thinks: string[] = []; constructor(rootStore: RootStore) { this.rootStore = rootStore; makeObservable(this); } @action.bound think(key: string = '$default') { this.thinks.push(key); } @action.bound completeOne(key: string) { this.thinks.splice(this.thinks.indexOf(key), 1); } @action.bound completeAll(key: string) { this.thinks = this.thinks.filter(k => k !== key); } isThinking(key: string = '$default') { return this.thinks.includes(key); } init() { console.debug('ThinkStore initialized'); } }