How to use the @talend/react-containers.Typeahead.setStateAction function in @talend/react-containers

To help you get started, we’ve selected a few @talend/react-containers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Talend / data-prep / dataprep-webapp / src / app / next / sagas / effects / search.effects.js View on Github external
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)
		);