Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
flatMap((resp: any) => {
if (resp.totalItems > 0) {
return [
new SetSearchResultAction(
resp.items.map((i: any) => i.volumeInfo.title),
),
new ClearAsyncErrorAction(
fs.controls.searchTerm.id,
'exists',
),
] as Action[];
}
return [
new SetSearchResultAction([]),
new SetAsyncErrorAction(
fs.controls.searchTerm.id,
'exists',
fs.value.searchTerm,
),
];
}),
catchError(_ => [