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

Function determineChangedProps

dash/dash-renderer/src/wrapper/selectors.ts:45–81  ·  view source on GitHub ↗
(
    state: any,
    strPath: string
)

Source from the content-addressed store, hash-verified

43};
44
45function determineChangedProps(
46 state: any,
47 strPath: string
48): ChangedPropsRecord {
49 let combinedHash = 0;
50 let renderType: any; // Default render type, adjust as needed
51 const changedProps: Record<string, any> = {};
52 Object.entries(state.layoutHashes).forEach(([updatedPath, pathHash]) => {
53 const [descendant, remainingSegments] = isFirstLevelPropsChild(
54 updatedPath,
55 strPath
56 );
57 if (descendant) {
58 const previousHash: any = pathOr({}, [updatedPath], previousHashes);
59 combinedHash += pathOr(0, ['hash'], pathHash);
60 if (previousHash !== pathHash) {
61 if (updatedPath !== strPath) {
62 Object.assign(changedProps, {[remainingSegments[1]]: true});
63 renderType = 'components';
64 } else {
65 Object.assign(
66 changedProps,
67 pathOr({}, ['changedProps'], pathHash)
68 );
69 renderType = pathOr({}, ['renderType'], pathHash);
70 }
71 previousHashes[updatedPath] = pathHash;
72 }
73 }
74 });
75
76 return {
77 hash: combinedHash,
78 changedProps,
79 renderType
80 };
81}
82
83export const selectDashProps =
84 (componentPath: DashLayoutPath) =>

Callers 1

selectDashPropsFunction · 0.85

Calls 2

isFirstLevelPropsChildFunction · 0.85
assignMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…