1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/technical-features/messaging/main/src/request-from-channel/request-from-channel.injectable.ts
Janne Savolainen 2a4fc4f20f
Add dummy implementations for requesting in main from renderer
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-03-21 09:28:22 +02:00

22 lines
603 B
TypeScript

import { getInjectable } from "@ogre-tools/injectable";
import {
RequestChannel,
RequestFromChannel,
requestFromChannelInjectionToken,
} from "@k8slens/messaging";
const requestFromChannelInjectable = getInjectable({
id: "request-from-channel",
instantiate: () =>
((channel: RequestChannel<any, any>) => {
throw new Error(
`Tried to request from channel "${channel.id}" but requesting in "main" it's not supported yet`,
);
}) as unknown as RequestFromChannel,
injectionToken: requestFromChannelInjectionToken,
});
export default requestFromChannelInjectable;