mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- Make injectable phases more explicit for renderer Signed-off-by: Sebastian Malton <sebastian@malton.name>
25 lines
899 B
TypeScript
25 lines
899 B
TypeScript
/**
|
|
* 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 { customMonacoThemeInjectionToken } from "../../components/monaco-editor";
|
|
import addNewMonacoThemeInjectable from "../../monaco/add-new-theme.injectable";
|
|
import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
|
|
|
const loadMonacoThemesInjectable = getInjectable({
|
|
id: "load-monaco-themes",
|
|
instantiate: (di) => ({
|
|
id: "load-monaco-themes",
|
|
run: () => {
|
|
const customThemes = di.injectMany(customMonacoThemeInjectionToken);
|
|
const addNewMonacoTheme = di.inject(addNewMonacoThemeInjectable);
|
|
|
|
customThemes.forEach(addNewMonacoTheme);
|
|
},
|
|
}),
|
|
injectionToken: beforeFrameStartsSecondInjectionToken,
|
|
});
|
|
|
|
export default loadMonacoThemesInjectable;
|