MCPcopy Create free account
hub / github.com/reactive-python/reactpy / wrapEventHandlers

Function wrapEventHandlers

src/py/reactpy/reactpy/web/templates/react.js:29–37  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

27}
28
29function wrapEventHandlers(props) {
30 const newProps = Object.assign({}, props);
31 for (const [key, value] of Object.entries(props)) {
32 if (typeof value === "function") {
33 newProps[key] = makeJsonSafeEventHandler(value);
34 }
35 }
36 return newProps;
37}
38
39function makeJsonSafeEventHandler(oldHandler) {
40 // Since we can't really know what the event handlers get passed we have to check if

Callers 1

bindFunction · 0.85

Calls 1

makeJsonSafeEventHandlerFunction · 0.85

Tested by

no test coverage detected