I am currently working with an AsyncIterable variable and I am trying to apply a filter on it. Take a look at the example below (pseudo code) -
class SomeClass {
private SOME_CONST= "ABCDE";
private async someFunction(): Promise<string> {
const items: AsyncIterable<string> = await someLibrary.getAsyncItems(); // this library's function returns type of AsyncIterable<T>
return items.filter(item => item === this.SOME_CONST);
}
}
I am encountering an error when trying to filter on AsyncIterable - "Property 'filter' does not exist on type 'AsyncIterable'