mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
20 lines
633 B
TypeScript
20 lines
633 B
TypeScript
import { createIpcChannel } from "./ipc";
|
|
import { ClusterId, clusterStore } from "./cluster-store";
|
|
import { tracker } from "./tracker";
|
|
|
|
export const clusterIpc = {
|
|
activate: createIpcChannel({
|
|
channel: "cluster:activate",
|
|
handle: async (clusterId: ClusterId = clusterStore.activeClusterId) => {
|
|
return clusterStore.getById(clusterId)?.activate();
|
|
},
|
|
}),
|
|
|
|
disconnect: createIpcChannel({
|
|
channel: "cluster:disconnect",
|
|
handle: (clusterId: ClusterId = clusterStore.activeClusterId) => {
|
|
tracker.event("cluster", "stop");
|
|
return clusterStore.getById(clusterId)?.disconnect();
|
|
},
|
|
}),
|
|
} |