NODEDC_TASKMANAGER/plane-src/apps/web/ce/store/root.store.ts

28 lines
820 B
TypeScript

/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
// store
import { CoreRootStore } from "@/store/root.store";
import type { ITimelineStore } from "./timeline";
export class RootStore extends CoreRootStore {
timelineStore: ITimelineStore | undefined;
private timelineStorePromise: Promise<ITimelineStore> | undefined;
loadTimelineStore = async (): Promise<ITimelineStore> => {
if (this.timelineStore) return this.timelineStore;
if (!this.timelineStorePromise) {
this.timelineStorePromise = import("./timeline").then(({ TimeLineStore }) => {
this.timelineStore = new TimeLineStore(this);
return this.timelineStore;
});
}
return this.timelineStorePromise;
}
}