mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Update injectable library (#4842)
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
This commit is contained in:
1 parent
e8ca1ddf87
commit
b65f6e00ec
231 files changed
+630
-613
No files matched your search
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { observable } from "mobx";
|
||||
import React from "react";
|
||||
|
||||
@@ -32,8 +32,8 @@ export class CommandOverlay {
|
||||
}
|
||||
|
||||
const commandOverlayInjectable = getInjectable({
|
||||
id: "command-overlay",
|
||||
instantiate: () => new CommandOverlay(),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default commandOverlayInjectable;
|
||||
+3
-2
@@ -12,7 +12,7 @@ import { HotbarSwitchCommand } from "../../hotbar/hotbar-switch-command";
|
||||
import { HotbarRenameCommand } from "../../hotbar/hotbar-rename-command";
|
||||
import { ActivateEntityCommand } from "../../activate-entity-command";
|
||||
import type { CommandContext, CommandRegistration } from "./commands";
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import commandOverlayInjectable from "../command-overlay.injectable";
|
||||
import createTerminalTabInjectable from "../../dock/terminal/create-terminal-tab.injectable";
|
||||
import type { DockTabCreate } from "../../dock/dock/store";
|
||||
@@ -205,6 +205,8 @@ function getInternalCommands({ openCommandDialog, getEntitySettingItems, createT
|
||||
}
|
||||
|
||||
const internalCommandsInjectable = getInjectable({
|
||||
id: "internal-commands",
|
||||
|
||||
instantiate: (di) => getInternalCommands({
|
||||
openCommandDialog: di.inject(commandOverlayInjectable).open,
|
||||
getEntitySettingItems: EntitySettingRegistry
|
||||
@@ -212,7 +214,6 @@ const internalCommandsInjectable = getInjectable({
|
||||
.getItemsForKind,
|
||||
createTerminalTab: di.inject(createTerminalTabInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default internalCommandsInjectable;
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed, IComputedValue } from "mobx";
|
||||
import type { CustomResourceDefinition } from "../../../../common/k8s-api/endpoints";
|
||||
import customResourceDefinitionsInjectable from "../../+custom-resources/custom-resources.injectable";
|
||||
@@ -41,13 +41,13 @@ const instantiateRegisteredCommands = ({ extensions, customResourceDefinitions,
|
||||
});
|
||||
|
||||
const registeredCommandsInjectable = getInjectable({
|
||||
id: "registered-commands",
|
||||
|
||||
instantiate: (di) => instantiateRegisteredCommands({
|
||||
extensions: di.inject(rendererExtensionsInjectable),
|
||||
customResourceDefinitions: di.inject(customResourceDefinitionsInjectable),
|
||||
internalCommands: di.inject(internalCommandsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default registeredCommandsInjectable;
|
||||
Reference in new issue
Block a user