mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
35 lines
1.2 KiB
TypeScript
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;
|