mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Get rid of this.disposers while registering stuff in extensions (#1148)
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
b765ee11bb
commit
67754ffbb9
15 files changed
+141
-197
No files matched your search
@@ -1,26 +1,16 @@
|
||||
import { LensRendererExtension, Registry } from "@k8slens/extensions";
|
||||
import { ExamplePage, ExampleIcon } from "./page"
|
||||
import { LensRendererExtension } from "@k8slens/extensions";
|
||||
import { ExampleIcon, ExamplePage } from "./page"
|
||||
import React from "react"
|
||||
|
||||
export default class ExampleExtension extends LensRendererExtension {
|
||||
onActivate() {
|
||||
console.log('EXAMPLE EXTENSION RENDERER: ACTIVATED', this.getMeta());
|
||||
}
|
||||
|
||||
registerClusterPage(registry: Registry.ClusterPageRegistry) {
|
||||
this.disposers.push(
|
||||
registry.add({
|
||||
path: "/extension-example",
|
||||
title: "Example Extension",
|
||||
components: {
|
||||
Page: () => <ExamplePage extension={this} />,
|
||||
MenuIcon: ExampleIcon,
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
onDeactivate() {
|
||||
console.log('EXAMPLE EXTENSION RENDERER: DEACTIVATED', this.getMeta());
|
||||
}
|
||||
clusterPages = [
|
||||
{
|
||||
path: "/extension-example",
|
||||
title: "Example Extension",
|
||||
components: {
|
||||
Page: () => <ExamplePage extension={this}/>,
|
||||
MenuIcon: ExampleIcon,
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user