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

Function validateState

dash/dash-renderer/src/actions/dependencies.js:581–609  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

579 const callbackIdsCheckedForState = {};
580
581 function validateState(callback) {
582 const {state, output} = callback;
583
584 // ensure we don't check the same callback for state multiple times
585 if (callbackIdsCheckedForState[output]) {
586 return;
587 }
588 callbackIdsCheckedForState[output] = 1;
589
590 const cls = 'State';
591
592 state.forEach(({id, property}) => {
593 if (typeof id === 'string') {
594 const idPath = getPath(paths, id);
595 if (!idPath) {
596 if (validateIds) {
597 missingId(id, cls, [callback]);
598 }
599 } else {
600 validateProp(id, idPath, property, cls, [callback]);
601 }
602 }
603 // Only validate props for State object ids that we don't need to
604 // resolve them to specific inputs or outputs
605 else if (!intersection([MATCH, ALLSMALLER], values(id)).length) {
606 validateIdPatternProp(id, property, cls, [callback]);
607 }
608 });
609 }
610
611 function validateMap(map, cls, doState) {
612 for (const id in map) {

Callers

nothing calls this directly

Calls 5

getPathFunction · 0.90
missingIdFunction · 0.85
validatePropFunction · 0.85
valuesFunction · 0.85
validateIdPatternPropFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…