MCPcopy Index your code
hub / github.com/plotly/dash / parsePatchProps

Function parsePatchProps

dash/dash-renderer/src/actions/patch.ts:307–331  ·  view source on GitHub ↗
(
    props: any,
    previousProps: any
)

Source from the content-addressed store, hash-verified

305}
306
307export function parsePatchProps(
308 props: any,
309 previousProps: any
310): Record<string, any> {
311 if (!is(Object, props)) {
312 return props;
313 }
314
315 const patchedProps: any = {};
316
317 for (const key of Object.keys(props)) {
318 const val = props[key];
319 if (isPatch(val)) {
320 const previousValue = previousProps[key];
321 if (previousValue === undefined) {
322 throw new Error('Cannot patch undefined');
323 }
324 patchedProps[key] = handlePatch(previousValue, val);
325 } else {
326 patchedProps[key] = val;
327 }
328 }
329
330 return patchedProps;
331}

Callers 4

sideUpdateFunction · 0.90
__executeFunction · 0.90
set_propsFunction · 0.90
processSetPropsFunction · 0.90

Calls 4

isPatchFunction · 0.85
handlePatchFunction · 0.85
keysMethod · 0.80
isFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…