Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Created June 4, 2020 15:47
Show Gist options
  • Save ljmotta/8fb6bee80ea9cc6267130f72289186b8 to your computer and use it in GitHub Desktop.
Save ljmotta/8fb6bee80ea9cc6267130f72289186b8 to your computer and use it in GitHub Desktop.
import { DefaultKeyboardShortcutsService, KeyboardShortcutsApi } from "@kogito-tooling/microeditor-envelope";
import { ChannelType, getOperatingSystem } from "@kogito-tooling/core-api";
export class EmbeddedEditorKeyboardShortcuts {
private static instance: KeyboardShortcutsApi;
public static getInstance(channel: ChannelType): KeyboardShortcutsApi {
if (!EmbeddedEditorKeyboardShortcuts.instance) {
console.log("new instance")
const editorContext = { channel, operatingSystem: getOperatingSystem() };
EmbeddedEditorKeyboardShortcuts.instance = new DefaultKeyboardShortcutsService(editorContext);
}
return EmbeddedEditorKeyboardShortcuts.instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment