TDMS/web/src/store/ThinkStore.ts
Maksim Skobaro c2d19a7724 improved, more featured, fixed
Exceptions and Errors are better
Files structure is better
New ComponentContext.ts
New DataTable.tsx tables.ts
Massive components refactoring
New Group.java
New LoggingRequestFilter.java LoggingSessionListener.java
New NotificationStore.ts SysInfoStore.ts
New reactiveValue.ts ReactiveControls.tsx
New dependencies
And much more
2025-02-07 07:05:15 +03:00

35 lines
784 B
TypeScript

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');
}
}