Files
lens/src/main/tray/tray-menu-item/tray-menu-item-injection-token.ts
T
Janne Savolainen f87f5f245c Simplify logic for injecting many instances which can reactively change e.g. based on extension being enabled or disabled (#5662)
* Reorganize stuff to prevent circular dependencies

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Install injectable extension to allow injecting reactively many implementations

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Switch to using computedInjectMany over filtering injectMany based on enabled extensions for simplicity

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove await for not being needed

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Sort dependencies alphabetically

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2022-06-20 10:19:20 +03:00

24 lines
643 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectionToken } from "@ogre-tools/injectable";
import type { IComputedValue } from "mobx";
export interface TrayMenuItem {
id: string;
parentId: string | null;
orderNumber: number;
enabled: IComputedValue<boolean>;
visible: IComputedValue<boolean>;
label?: IComputedValue<string>;
click?: () => Promise<void> | void;
tooltip?: string;
separator?: boolean;
}
export const trayMenuItemInjectionToken = getInjectionToken<TrayMenuItem>({
id: "tray-menu-item",
});