The most generic AsyncIterableX.pipe overload
|
pipe(...operations: OperatorAsyncFunction<any, any>[]): AsyncIterableX<any>; |
can end up being chosen by the TypeScript compiler in unexpected circumstances leading to type errors being missed due to an AsyncIterableX of any being returned.
The following function exhibits this behavior:
import { of } from 'ix/asynciterable/index.js';
import { map, tap } from 'ix/asynciterable/operators/index.js';
export function subscribe(): AsyncIterable<{ brand: 'X' }> {
return of(undefined).pipe(
map(event => ({ brand: 'Y' })),
tap()
);
}
The overload should be removed or at the very least should return an AsyncIterableX of unknown.
The most generic AsyncIterableX.pipe overload
IxJS/src/asynciterable/asynciterablex.ts
Line 447 in 4a1d9c8
The following function exhibits this behavior:
The overload should be removed or at the very least should return an AsyncIterableX of unknown.