MCPcopy Create free account
hub / github.com/streamich/react-use / wrapEvent

Function wrapEvent

src/factory/createHTMLMediaHook.ts:58–66  ·  view source on GitHub ↗
(userEvent, proxyEvent?)

Source from the content-addressed store, hash-verified

56 const ref = useRef<T | null>(null);
57
58 const wrapEvent = (userEvent, proxyEvent?) => {
59 return (event) => {
60 try {
61 proxyEvent && proxyEvent(event);
62 } finally {
63 userEvent && userEvent(event);
64 }
65 };
66 };
67
68 const onPlay = () => setState({ paused: false });
69 const onPlaying = () => setState({ playing: true });

Callers 1

createHTMLMediaHookFunction · 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…