Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function* search(payload) {
yield put(Typeahead.setStateAction({ searching: true }, 'headerbar:search'));
const categories = api.registry.getFromRegistry('SEARCH_CATEGORIES_BY_PROVIDER');
const providers = Object.keys(categories);
const service = new SearchService(categories);
const batches = providers.map(
provider => service.build(
provider,
payload,
)
);
const results = (
yield all(batches.map(request => call(...request)))
).map(
(result, index) => service.transform(providers[index], result)
);