Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
refactor(lodash): remove zipWith (#2459)
Browse files Browse the repository at this point in the history
* refactor(lodash): remove zipWith

IFW-737

* chore: add comment back
  • Loading branch information
Haroenv committed May 16, 2019
1 parent a846b44 commit 4670c07
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEmpty, zipWith } from 'lodash';
import { isEmpty } from 'lodash';
import React, { Component } from 'react';
import { renderToString } from 'react-dom/server';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -81,16 +81,14 @@ const multiIndexSearch = (
})
);

// We attach `indexId` on the results to be able to reconstruct the
// object client side. We cannot rely on `state.index` anymore because
// we may have multiple times the same index.
return Promise.all(search).then(results =>
zipWith([indexName, ...indexIds], results, (indexId, result) =>
// We attach `indexId` on the results to be able to reconstruct the
// object client side. We cannot rely on `state.index` anymore because
// we may have multiple times the same index.
({
...result,
_internalIndexId: indexId,
})
)
[indexName, ...indexIds].map((indexId, i) => ({
...results[i],
_internalIndexId: indexId,
}))
);
};

Expand Down

0 comments on commit 4670c07

Please sign in to comment.