1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/context-handler/create-context-handler.injectable.ts
Janne Savolainen eecd4d556e
Remove explicit singleton as lifecycle for being default
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2022-02-14 13:30:13 +02:00

23 lines
765 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 type { Cluster } from "../../common/cluster/cluster";
import { ContextHandler } from "./context-handler";
import createKubeAuthProxyInjectable from "../kube-auth-proxy/create-kube-auth-proxy.injectable";
const createContextHandlerInjectable = getInjectable({
id: "create-context-handler",
instantiate: (di) => {
const dependencies = {
createKubeAuthProxy: di.inject(createKubeAuthProxyInjectable),
};
return (cluster: Cluster) => new ContextHandler(dependencies, cluster);
},
});
export default createContextHandlerInjectable;