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

Function addCallbackIfArray

dash/dash-renderer/src/actions/dependencies.js:1294–1315  ·  view source on GitHub ↗
(idStr)

Source from the content-addressed store, hash-verified

1292 }
1293
1294 function addCallbackIfArray(idStr) {
1295 return cb =>
1296 cb.getInputs(paths).some(ini => {
1297 if (
1298 Array.isArray(ini) &&
1299 ini.some(inij => stringifyId(inij.id) === idStr)
1300 ) {
1301 // This callback should trigger even with no changedProps,
1302 // since the props that changed no longer exist.
1303 // We're kind of abusing the `initialCall` flag here, it's
1304 // more like a "final call" for the removed inputs, but
1305 // this case is not subject to `prevent_initial_call`.
1306 if (flatten(cb.getOutputs(newPaths)).length) {
1307 cb.initialCall = true;
1308 cb.changedPropIds = {};
1309 addCallback(cb);
1310 }
1311 return true;
1312 }
1313 return false;
1314 });
1315 }
1316
1317 function handleOneId(id, outIdCallbacks, inIdCallbacks) {
1318 if (outIdCallbacks) {

Callers 1

handleOneIdFunction · 0.85

Calls 2

stringifyIdFunction · 0.85
addCallbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…