1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/technical-features/messaging/electron/main/src/request-from-channel/request-from-channel.injectable.ts
Sebastian Malton 6184c2f03b chore: Fix lint for non @k8slens/core packages
- Update eslint config to be tighter in control

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:12:17 -04:00

15 lines
588 B
TypeScript

import { getInjectable } from "@ogre-tools/injectable";
import { RequestChannel, RequestFromChannel, requestFromChannelInjectionToken } from "@k8slens/messaging";
const requestFromChannelInjectable = getInjectable({
id: "request-from-channel",
instantiate: () =>
(async <Request, Response>(channel: RequestChannel<Request, Response>) => {
throw new Error(`Tried to request from channel "${channel.id}" from main, which is not supported.`);
}) as RequestFromChannel,
injectionToken: requestFromChannelInjectionToken,
});
export default requestFromChannelInjectable;