Demonstrate how InjectNaive could be not naive by using injectables

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2021-12-04 12:20:42 +02:00
1 parent 78e1c6357b
commit 7938e9c4ef
17 files changed
+392 -142

No files matched your search

@@ -32,11 +32,11 @@ export interface KubeObjectMenuRegistration {
components: KubeObjectMenuComponents;
}
export interface IHasGettableItemsForKind {
export interface IKubeObjectMenuRegistry {
getItemsForKind(kind: string, apiVersion: string): any;
}
export class KubeObjectMenuRegistry extends BaseRegistry<KubeObjectMenuRegistration> implements IHasGettableItemsForKind {
export class KubeObjectMenuRegistry extends BaseRegistry<KubeObjectMenuRegistration> implements IKubeObjectMenuRegistry {
getItemsForKind = (kind: string, apiVersion: string) =>
this.getItems().filter((item) =>
item.kind === kind && item.apiVersions.includes(apiVersion),