MCPcopy Index your code
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 const styles = createStyles()
26
27 const toggleModifier = (modifier: KeyboardKey) => {
28 if (props.hotkey.includes(modifier)) {
29 props.onHotkeyChange(props.hotkey.filter((key) => key !== modifier))
30 } else {
31 const existingModifiers = props.hotkey.filter((key) =>
32 props.modifiers.includes(key as any),
33 )
34 const otherKeys = props.hotkey.filter(
35 (key) => !props.modifiers.includes(key as any),
36 )
37 props.onHotkeyChange([...existingModifiers, modifier, ...otherKeys])
38 }
39 }
40
41 const getNonModifierValue = () => {
42 return props.hotkey

Callers 1

HotkeyConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected