1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Add dummy implementations for requesting in main from renderer

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2023-03-17 15:50:57 +02:00
parent 94cdf84712
commit 2a4fc4f20f
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,21 @@
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;

View File

@ -0,0 +1,18 @@
/* c8 ignore start */
import { getInjectable } from "@ogre-tools/injectable";
import { enlistRequestChannelListenerInjectionToken } from "@k8slens/messaging";
const enlistRequestChannelListenerInjectable = getInjectable({
id: "enlist-request-channel-listener-for-renderer",
instantiate: () => (listener) => {
throw new Error(
`Tried to enlist request channel "${listener.channel.id}" in "renderer", but requesting it's not supported yet.`,
);
},
injectionToken: enlistRequestChannelListenerInjectionToken,
});
export default enlistRequestChannelListenerInjectable;
/* c8 ignore end */