mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Move init hotbar store into runnables
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
f7b5ae7b57
commit
56c78c8c8b
26
src/features/hotbar/store/main/init.injectable.ts
Normal file
26
src/features/hotbar/store/main/init.injectable.ts
Normal 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 hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
||||
import { beforeApplicationIsLoadingInjectionToken } from "../../../../main/start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
||||
import initClusterStoreInjectable from "../../../cluster/store/main/init.injectable";
|
||||
|
||||
const initHotbarStoreInjectable = getInjectable({
|
||||
id: "init-hotbar-store",
|
||||
instantiate: (di) => {
|
||||
const hotbarStore = di.inject(hotbarStoreInjectable);
|
||||
|
||||
return {
|
||||
id: "init-hotbar-store",
|
||||
run: () => {
|
||||
hotbarStore.load();
|
||||
},
|
||||
runAfter: di.inject(initClusterStoreInjectable),
|
||||
};
|
||||
},
|
||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||
});
|
||||
|
||||
export default initHotbarStoreInjectable;
|
||||
26
src/features/hotbar/store/renderer/init.injectable.ts
Normal file
26
src/features/hotbar/store/renderer/init.injectable.ts
Normal 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 hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../../../../renderer/before-frame-starts/tokens";
|
||||
import initClusterStoreInjectable from "../../../cluster/store/renderer/init.injectable";
|
||||
|
||||
const initHotbarStoreInjectable = getInjectable({
|
||||
id: "init-hotbar-store",
|
||||
instantiate: (di) => {
|
||||
const hotbarStore = di.inject(hotbarStoreInjectable);
|
||||
|
||||
return {
|
||||
id: "init-hotbar-store",
|
||||
run: () => {
|
||||
hotbarStore.load();
|
||||
},
|
||||
runAfter: di.inject(initClusterStoreInjectable),
|
||||
};
|
||||
},
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
export default initHotbarStoreInjectable;
|
||||
@ -25,7 +25,6 @@ import initClusterFrameInjectable from "./frames/cluster-frame/init-cluster-fram
|
||||
import { Router } from "react-router";
|
||||
import historyInjectable from "./navigation/history.injectable";
|
||||
import themeStoreInjectable from "./themes/store.injectable";
|
||||
import hotbarStoreInjectable from "../common/hotbars/store.injectable";
|
||||
import assert from "assert";
|
||||
import startFrameInjectable from "./start-frame/start-frame.injectable";
|
||||
|
||||
@ -46,9 +45,6 @@ export async function bootstrap(di: DiContainer) {
|
||||
|
||||
extensionDiscovery.init();
|
||||
|
||||
// HotbarStore depends on: ClusterStore
|
||||
di.inject(hotbarStoreInjectable).load();
|
||||
|
||||
// ThemeStore depends on: UserStore
|
||||
// TODO: Remove temporal dependencies
|
||||
di.inject(themeStoreInjectable);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user