1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make temporal dependency apparent

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-04-27 11:47:23 +03:00
parent c9832a2702
commit 1e4a140a55
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
3 changed files with 28 additions and 2 deletions

View File

@ -44,8 +44,8 @@ export class HotbarStore extends BaseStore<HotbarStoreModel> {
}, },
migrations, migrations,
}); });
makeObservable(this); makeObservable(this);
this.load();
} }
@computed get activeHotbarId() { @computed get activeHotbarId() {

View File

@ -0,0 +1,26 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { afterApplicationIsReadyInjectionToken } from "../after-application-is-ready-injection-token";
import hotbarStoreInjectable from "../../../../common/hotbar-store.injectable";
import setupSyncingOfGeneralCatalogEntitiesInjectable from "./setup-syncing-of-general-catalog-entities.injectable";
const setupHotbarStoreInjectable = getInjectable({
id: "setup-hotbar-store",
instantiate: (di) => ({
run: () => {
const hotbarStore = di.inject(hotbarStoreInjectable);
hotbarStore.load();
},
runAfter: di.inject(setupSyncingOfGeneralCatalogEntitiesInjectable),
}),
injectionToken: afterApplicationIsReadyInjectionToken,
});
export default setupHotbarStoreInjectable;

View File

@ -122,7 +122,7 @@ export async function bootstrap(di: DiContainer) {
await clusterStore.loadInitialOnRenderer(); await clusterStore.loadInitialOnRenderer();
// HotbarStore depends on: ClusterStore // HotbarStore depends on: ClusterStore
di.inject(hotbarStoreInjectable); di.inject(hotbarStoreInjectable).load();
// ThemeStore depends on: UserStore // ThemeStore depends on: UserStore
// TODO: Remove temporal dependencies // TODO: Remove temporal dependencies