Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 19, 2021
1 parent 5ab119a commit e0457bc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/combination/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ export const sortCombinations = function (result) {

// Retrieve a function used to compare combinations for a specific dimension
const getSortFunction = function ({ propName }, combinations) {
const meansOfMeans = mapObj(
groupBy(combinations, ({ dimensions }) => dimensions[propName].id),
getMeanOfMeans,
const combinationsGroups = groupBy(
combinations,
({ dimensions }) => dimensions[propName].id,
)
const meansOfMeans = mapObj(combinationsGroups, getMeanOfMeans)
return getCombinationOrder.bind(undefined, propName, meansOfMeans)
}

Expand Down

0 comments on commit e0457bc

Please sign in to comment.