1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/cluster-frame-context/cluster-frame-context.injectable.ts
Janne Savolainen 096aed6aba Update version of injectable for
- Allow hierarchy of setuppables
- Detection of circular injections
- Detection of circular setuppables
- Better error messages for injecting non-registered injectables
- Introduce injectMany as new pattern
- Introduce keyed singletons as new lifecycle
- Allow instantiation parameter of any type

Adapt to new version of injectable

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-24 14:16:22 -05:00

27 lines
829 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 { ClusterFrameContext } from "./cluster-frame-context";
import namespaceStoreInjectable from "../components/+namespaces/namespace-store/namespace-store.injectable";
import hostedClusterInjectable from "../../common/cluster-store/hosted-cluster.injectable";
const clusterFrameContextInjectable = getInjectable({
id: "cluster-frame-context",
instantiate: (di) => {
const cluster = di.inject(hostedClusterInjectable);
return new ClusterFrameContext(
cluster,
{
namespaceStore: di.inject(namespaceStoreInjectable),
},
);
},
});
export default clusterFrameContextInjectable;