mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Demonstrate how InjectNaive could be not naive by using injectables
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
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),
|
||||
|
||||
Reference in new issue
Block a user