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
35 lines
784 B
TypeScript
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');
|
|
}
|
|
} |