1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/frames/root-frame/notify-that-root-frame-is-rendered.injectable.ts
Janne Savolainen e30a8c13ee
Make stuff happening when root frame is rendered unit testable
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2022-06-03 07:48:03 +03:00

23 lines
905 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 { sendToAgnosticChannelInjectionToken } from "../../../common/channel/send-to-agnostic-channel-injection-token";
import rootFrameRenderedChannelInjectable from "../../../common/root-frame-rendered-channel/root-frame-rendered-channel.injectable";
const notifyThatRootFrameIsRenderedInjectable = getInjectable({
id: "notify-that-root-frame-is-rendered",
instantiate: (di) => {
const sendToAgnosticChannel = di.inject(sendToAgnosticChannelInjectionToken);
const rootFrameRenderedChannel = di.inject(rootFrameRenderedChannelInjectable);
return () => {
sendToAgnosticChannel(rootFrameRenderedChannel);
};
},
});
export default notifyThatRootFrameIsRenderedInjectable;