plane/web/store/cycles.ts

55 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-09-20 06:52:48 +00:00
import { action, computed, observable, makeObservable, runInAction } from "mobx";
// types
import { RootStore } from "./root";
// services
2023-09-21 09:30:19 +00:00
import { ProjectService } from "services/project.service";
import { IssueService } from "services/issue.service";
2023-09-25 07:05:42 +00:00
import { ICycle } from "types";
2023-09-20 06:52:48 +00:00
export interface ICycleStore {
loader: boolean;
error: any | null;
2023-09-25 07:05:42 +00:00
cycles: {
[cycle_id: string]: ICycle;
};
2023-09-20 06:52:48 +00:00
}
class CycleStore implements ICycleStore {
loader: boolean = false;
error: any | null = null;
2023-09-25 07:05:42 +00:00
cycles: {
[cycle_id: string]: ICycle;
} = {};
2023-09-20 06:52:48 +00:00
// root store
rootStore;
// services
projectService;
issueService;
constructor(_rootStore: RootStore) {
makeObservable(this, {
loader: observable,
error: observable.ref,
2023-09-25 07:05:42 +00:00
cycles: observable.ref,
2023-09-20 06:52:48 +00:00
// computed
// actions
});
this.rootStore = _rootStore;
2023-09-21 09:30:19 +00:00
this.projectService = new ProjectService();
this.issueService = new IssueService();
2023-09-20 06:52:48 +00:00
}
// computed
// actions
}
export default CycleStore;