From dbea7787f95056eb0e2d83553ee7553663d0037e Mon Sep 17 00:00:00 2001 From: eff-kay Date: Fri, 7 May 2021 13:21:43 -0400 Subject: [PATCH] :construction: WIP callback pruning --- dash-renderer/src/TreeContainer.js | 1 - dash-renderer/src/actions/dependencies_ts.ts | 25 ++++++++++---------- dash-renderer/src/actions/index.js | 12 ++++------ 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/dash-renderer/src/TreeContainer.js b/dash-renderer/src/TreeContainer.js index 4213b13428..b1e6a42f8b 100644 --- a/dash-renderer/src/TreeContainer.js +++ b/dash-renderer/src/TreeContainer.js @@ -127,7 +127,6 @@ class BaseTreeContainer extends Component { newProps ); - console.log("props", newProps, "old", oldProps); if (!isEmpty(changedProps)) { // Identify the modified props that are required for callbacks const watchedKeys = getWatchedKeys( diff --git a/dash-renderer/src/actions/dependencies_ts.ts b/dash-renderer/src/actions/dependencies_ts.ts index 6b8ba44784..0c5519c48a 100644 --- a/dash-renderer/src/actions/dependencies_ts.ts +++ b/dash-renderer/src/actions/dependencies_ts.ts @@ -78,18 +78,17 @@ export function callbackPathExists(graphs:any, paths:any, fromCallback:ICallback )) if (!callbacks.length){ - //we have reached the end of the DAG + //we have reached the end of the graph return false; } + // not exactly clear why this extra step was required const matches: ICallback[] = []; callbacks.forEach( addAllResolvedFromOutputs(resolveDeps(), paths, matches) ); - const exists = matches.some((cb)=>{return callbackPathExists(graphs, paths, cb, toCallback)}) - console.log('CALLDAG:callbackPathExists callbacks',exists); - return exists; + return matches.some((cb)=>{return callbackPathExists(graphs, paths, cb, toCallback)}) } export function getCallbacksByInput( @@ -345,15 +344,15 @@ export function includeObservers( var validCbs = [... flattenedCbs]; - //TODO: not sure if this is optimal - // for(let i=0; i