I have a variable of type AsyncIterable. I want to filter on it, for example (psuedo code below) -
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);
}
}
How can I filter on AsyncIterable? I get the error - "Property 'filter' does not exist on type 'AsyncIterable'