Add implementation for injection token

This commit is contained in:
Juho Heikka committed 2023-03-16 10:13:56 +02:00
1 parent 4b2b4ad399
commit eae90f64f5
11 files changed
+82 -100

No files matched your search

@@ -6,7 +6,7 @@ import { getInjectionToken } from "@ogre-tools/injectable";
export type ClusterOverviewUIBlock = {
id: string;
component: React.ElementType;
text: string;
};
export const clusterOverviewUIBlockInjectionToken = getInjectionToken<ClusterOverviewUIBlock>({
@@ -0,0 +1,15 @@
import { getFeature } from "@k8slens/feature-core";
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
export const metricsFeature = getFeature({
id: "metrics",
register: (di) => {
autoRegister({
di,
targetModule: module,
getRequireContexts: () => [require.context("./", true, /\.injectable\.(ts|tsx)$/)],
});
},
});