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

Function getProps

dash/dash-renderer/src/persistence.js:285–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283 `${stringifyId(id)}.${persistedProp}.${JSON.stringify(persistence)}`;
284
285const getProps = layout => {
286 const {props, type, namespace} = layout;
287 if (!type || !namespace) {
288 // not a real component - just need the props for recursion
289 return {props};
290 }
291 const {id, persistence} = props;
292
293 const element = Registry.resolve(layout);
294 const getVal = prop =>
295 props[prop] ||
296 (element.defaultProps || element.dashPersistence || {})[prop];
297 const persisted_props = getVal('persisted_props');
298 const persistence_type = getVal('persistence_type');
299 const canPersist = id && persisted_props && persistence_type;
300
301 return {
302 canPersist,
303 id,
304 props,
305 element,
306 persistence,
307 persisted_props,
308 persistence_type
309 };
310};
311
312export function recordUiEdit(layout, newProps, dispatch) {
313 const {

Callers 3

recordUiEditFunction · 0.70
persistenceModsFunction · 0.70
prunePersistenceFunction · 0.70

Calls 1

getValFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…