command palette control

This commit is contained in:
Jan Prochazka
2021-02-25 18:05:44 +01:00
parent 30ade5867c
commit f0802dc471
13 changed files with 706 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
import { get } from 'svelte/store';
import { commands } from '../stores';
import { GlobalCommand } from './registerCommand';
export default function runCommand(commandId: string) {
const commandsValue = get(commands);
const command: GlobalCommand = commandsValue[commandId];
if (command.enabled) command.onClick();
}