Skip to content

Commit e573295

Browse files
committed
change leftover "any" vars to "match"
ANY was the original name of the MATCH wildcard... some variable names didn't make the switch
1 parent de5a465 commit e573295

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

dash-renderer/src/actions/dependencies.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,12 @@ function findInOutOverlap(outputs, inputs, head, dispatchError) {
397397
}
398398

399399
function findMismatchedWildcards(outputs, inputs, state, head, dispatchError) {
400-
const {anyKeys: out0AnyKeys} = findWildcardKeys(outputs[0].id);
401-
outputs.forEach((out, outi) => {
402-
if (outi && !equals(findWildcardKeys(out.id).anyKeys, out0AnyKeys)) {
400+
const {matchKeys: out0MatchKeys} = findWildcardKeys(outputs[0].id);
401+
outputs.forEach((out, i) => {
402+
if (i && !equals(findWildcardKeys(out.id).matchKeys, out0MatchKeys)) {
403403
dispatchError('Mismatched `MATCH` wildcards across `Output`s', [
404404
head,
405-
`Output ${outi} (${combineIdAndProp(out)})`,
405+
`Output ${i} (${combineIdAndProp(out)})`,
406406
'does not have MATCH wildcards on the same keys as',
407407
`Output 0 (${combineIdAndProp(outputs[0])}).`,
408408
'MATCH wildcards must be on the same keys for all Outputs.',
@@ -415,9 +415,9 @@ function findMismatchedWildcards(outputs, inputs, state, head, dispatchError) {
415415
[state, 'State'],
416416
].forEach(([args, cls]) => {
417417
args.forEach((arg, i) => {
418-
const {anyKeys, allsmallerKeys} = findWildcardKeys(arg.id);
419-
const allWildcardKeys = anyKeys.concat(allsmallerKeys);
420-
const diff = difference(allWildcardKeys, out0AnyKeys);
418+
const {matchKeys, allsmallerKeys} = findWildcardKeys(arg.id);
419+
const allWildcardKeys = matchKeys.concat(allsmallerKeys);
420+
const diff = difference(allWildcardKeys, out0MatchKeys);
421421
if (diff.length) {
422422
diff.sort();
423423
dispatchError('`Input` / `State` wildcards not in `Output`s', [
@@ -640,7 +640,7 @@ export function computeGraphs(dependencies, dispatchError) {
640640
* {[id]: {[prop]: [callback, ...]}}
641641
* where callbacks are the matching specs from the original
642642
* dependenciesRequest, but with outputs parsed to look like inputs,
643-
* and a list anyKeys added if the outputs have MATCH wildcards.
643+
* and a list matchKeys added if the outputs have MATCH wildcards.
644644
* For outputMap there should only ever be one callback per id/prop
645645
* but for inputMap there may be many.
646646
*
@@ -786,10 +786,10 @@ export function computeGraphs(dependencies, dispatchError) {
786786
// Also collect MATCH keys in the output (all outputs must share these)
787787
// and ALL keys in the first output (need not be shared but we'll use
788788
// the first output for calculations) for later convenience.
789-
const {anyKeys} = findWildcardKeys(outputs[0].id);
789+
const {matchKeys} = findWildcardKeys(outputs[0].id);
790790
const firstSingleOutput = findIndex(o => !isMultiValued(o.id), outputs);
791791
const finalDependency = mergeRight(
792-
{anyKeys, firstSingleOutput, outputs},
792+
{matchKeys, firstSingleOutput, outputs},
793793
dependency
794794
);
795795

@@ -822,20 +822,20 @@ export function computeGraphs(dependencies, dispatchError) {
822822
}
823823

824824
function findWildcardKeys(id) {
825-
const anyKeys = [];
825+
const matchKeys = [];
826826
const allsmallerKeys = [];
827827
if (typeof id === 'object') {
828828
forEachObjIndexed((val, key) => {
829829
if (val === MATCH) {
830-
anyKeys.push(key);
830+
matchKeys.push(key);
831831
} else if (val === ALLSMALLER) {
832832
allsmallerKeys.push(key);
833833
}
834834
}, id);
835-
anyKeys.sort();
835+
matchKeys.sort();
836836
allsmallerKeys.sort();
837837
}
838-
return {anyKeys, allsmallerKeys};
838+
return {matchKeys, allsmallerKeys};
839839
}
840840

841841
/*
@@ -1064,8 +1064,8 @@ function addResolvedFromOutputs(callback, outPattern, outs, matches) {
10641064

10651065
function addAllResolvedFromOutputs(resolve, paths, matches) {
10661066
return callback => {
1067-
const {anyKeys, firstSingleOutput, outputs} = callback;
1068-
if (anyKeys.length) {
1067+
const {matchKeys, firstSingleOutput, outputs} = callback;
1068+
if (matchKeys.length) {
10691069
const singleOutPattern = outputs[firstSingleOutput];
10701070
if (singleOutPattern) {
10711071
addResolvedFromOutputs(
@@ -1083,9 +1083,9 @@ function addAllResolvedFromOutputs(resolve, paths, matches) {
10831083
const anySeen = {};
10841084
outputs.forEach(outPattern => {
10851085
const outSet = resolve(paths)(outPattern).filter(i => {
1086-
const matchKeys = JSON.stringify(props(anyKeys, i.id));
1087-
if (!anySeen[matchKeys]) {
1088-
anySeen[matchKeys] = 1;
1086+
const matchStr = JSON.stringify(props(matchKeys, i.id));
1087+
if (!anySeen[matchStr]) {
1088+
anySeen[matchStr] = 1;
10891089
return true;
10901090
}
10911091
return false;

0 commit comments

Comments
 (0)