1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/core/src/main/lens-proxy/close-on-quit.injectable.ts
Sebastian Malton 702f8863d9 Close Lens Proxy on quit of backend (#7453)
- Extract global shared state of shell sessions

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-03-31 14:37:35 -04:00

22 lines
709 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 { beforeQuitOfBackEndInjectionToken } from "../start-main-application/runnable-tokens/phases";
import lensProxyInjectable from "./lens-proxy.injectable";
const closeLensProxyOnQuitInjectable = getInjectable({
id: "close-lens-proxy-on-quit",
instantiate: (di) => ({
run: async () => {
const lensProxy = di.inject(lensProxyInjectable);
await lensProxy.close();
},
}),
injectionToken: beforeQuitOfBackEndInjectionToken,
});
export default closeLensProxyOnQuitInjectable;