mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Make ClusterFrameManager fully injectable Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix type errors Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
22 lines
967 B
TypeScript
22 lines
967 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import { getInjectable } from "@ogre-tools/injectable";
|
|
import type { MessageChannelHandler } from "../../../common/utils/channel/message-channel-listener-injection-token";
|
|
import { sendMessageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
|
|
import { clusterVisibilityChannel } from "../../../common/cluster/visibility-channel";
|
|
|
|
export type EmitClusterVisibility = MessageChannelHandler<typeof clusterVisibilityChannel>;
|
|
|
|
const emitClusterVisibilityInjectable = getInjectable({
|
|
id: "emit-cluster-visibility",
|
|
instantiate: (di): EmitClusterVisibility => {
|
|
const sendMessageToChannel = di.inject(sendMessageToChannelInjectionToken);
|
|
|
|
return (id) => sendMessageToChannel(clusterVisibilityChannel, id);
|
|
},
|
|
});
|
|
|
|
export default emitClusterVisibilityInjectable;
|