MCPcopy Index your code
hub / github.com/streamich/react-use / createKeyPredicate

Function createKeyPredicate

src/useKey.ts:15–22  ·  view source on GitHub ↗
(keyFilter: KeyFilter)

Source from the content-addressed store, hash-verified

13}
14
15const createKeyPredicate = (keyFilter: KeyFilter): KeyPredicate =>
16 typeof keyFilter === 'function'
17 ? keyFilter
18 : typeof keyFilter === 'string'
19 ? (event: KeyboardEvent) => event.key === keyFilter
20 : keyFilter
21 ? () => true
22 : () => false;
23
24const useKey = <T extends UseEventTarget>(
25 key: KeyFilter,

Callers 1

useKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…