MCPcopy Create free account
hub / github.com/TanStack/devtools / toggleModifier

Function toggleModifier

packages/devtools/src/tabs/hotkey-config.tsx:27–39  ·  view source on GitHub ↗
(modifier: KeyboardKey)

Source from the content-addressed store, hash-verified

25
26 const toggleModifier = (modifier: KeyboardKey) => {
27 if (props.hotkey.includes(modifier)) {
28 props.onHotkeyChange(props.hotkey.filter((key) => key !== modifier))
29 } else {
30 const existingModifiers = props.hotkey.filter((key) =>
31 props.modifiers.includes(key as any),
32 )
33 const otherKeys = props.hotkey.filter(
34 (key) => !props.modifiers.includes(key as any),
35 )
36 props.onHotkeyChange([...existingModifiers, modifier, ...otherKeys])
37 }
38 }
39
40 const getNonModifierValue = () => {
41 return props.hotkey
42 .filter((key) => !props.modifiers.includes(key as any))

Callers 1

HotkeyConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected