and even mooooore tweaks
This commit is contained in:
parent
fb4d28b265
commit
1c0810290b
7 changed files with 40 additions and 22 deletions
|
@ -32,7 +32,16 @@ export const createCommand = (label: string, command: () => any, shortcut?: Comm
|
|||
});
|
||||
};
|
||||
|
||||
export const noop = createCommand('noop', () => { });
|
||||
export const noop = Object.defineProperties(createCommand('noop', () => { }), {
|
||||
withLabel: {
|
||||
value(label: string) {
|
||||
return createCommand(label, () => { });
|
||||
},
|
||||
configurable: false,
|
||||
writable: false,
|
||||
},
|
||||
}) as CommandType & { withLabel(label: string): CommandType };
|
||||
|
||||
|
||||
export const Command: Component<{ command: CommandType }> = (props) => {
|
||||
return <>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue