Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 26, 2021
1 parent 3cde067 commit 1caadb0
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/system/footer/shared_2.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,28 @@ const isReducibleDimensions = function ({
}) {
return Object.entries(dimensionsB).every(
([dimensionNameB, dimensionValueB]) =>
system.dimensions[dimensionNameB] === dimensionValueB ||
(indexB === index && dimensionNameB === dimensionName),
isReducibleDimension({
system,
index,
indexB,
dimensionName,
dimensionNameB,
dimensionValueB,
}),
)
}

const isReducibleDimension = function ({
system,
index,
indexB,
dimensionName,
dimensionNameB,
dimensionValueB,
}) {
return (
system.dimensions[dimensionNameB] === dimensionValueB ||
(indexB === index && dimensionNameB === dimensionName)
)
}

Expand Down

0 comments on commit 1caadb0

Please sign in to comment.