With the code below I get a value every 500ms and I take 10 of them.
Now I want to filter out invalid values but the function I want to call is asynchronous (but happens very quickly) and I don't know how to do that in the filter operator.
this.subscription = this.input.getStream()
.throttleTime(500)
.filter(value => {
// I want to filter out invalid values
// but the function I want to call here is async
})
.take(10) // and get 10 valid ones
.subscribe(value => {
this.values.push(value)
})
Note: I want the filter to happen after the time throttling.