my example code is
this.urls$.pipe(
map(async (val) => {
return await http.get(url);
}),
tap(async (val) => {
const res = await val.res;
console.log(res);
return ture;
})
).subscribe();
but i got a eslint message.
Promise returned in function argument where a void return was expected.eslint
how can i avoid this?
Instead of awaiting a promise within map, you could convert the promise to an observable and use switchMap (or simelar) operator.
this.urls$.pipe(
switchMap((val) => from(http.get(url))),
tap((val) => console.log(val.res)),
).subscribe();