1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/app-paths/setup-app-paths.injectable.ts
Sebastian Malton f8702591f4 Fix kubeconfig-sync sometimes producing multiple identical entities (#5855)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-10-20 10:06:34 -04:00

35 lines
1.2 KiB
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 appPathsStateInjectable from "../../common/app-paths/app-paths-state.injectable";
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/before-frame-starts-injection-token";
import appPathsChannelInjectable from "../../common/app-paths/app-paths-channel.injectable";
import { requestFromChannelInjectionToken } from "../../common/utils/channel/request-from-channel-injection-token";
const setupAppPathsInjectable = getInjectable({
id: "setup-app-paths",
instantiate: (di) => {
const requestFromChannel = di.inject(requestFromChannelInjectionToken);
const appPathsChannel = di.inject(appPathsChannelInjectable);
const appPathsState = di.inject(appPathsStateInjectable);
return {
id: "setup-app-paths",
run: async () => {
const appPaths = await requestFromChannel(
appPathsChannel,
);
appPathsState.set(appPaths);
},
};
},
injectionToken: beforeFrameStartsInjectionToken,
});
export default setupAppPathsInjectable;