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

refactor(lodash): remove zipWith #2459

Merged
merged 2 commits into from
May 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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