pipe does not properly support rest parameters in some cases.
Open
@benlesh is already working on this.
Since Sep 24, 2018.
feature
- Dominant language
- TypeScript
- Stars
- 31.7k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Description
I encountered this while updating Angular CLI.
In particular, the update to the base.ts file in there, where I'm adding as any was necessary because the spreading of an array of operators into pipe was not working.
EDIT: It seems that we can't support rest params without breaking inference enforcement from operator to operator in the pipe. So here's a proposal:
Proposed Feature
Add an overload of pipe that accepts OperatorFunction<any, any>[] and returns Observable<R>:
pipe<R>(operations: OperationFunction<any, any>[]): Observable<R>;
// usage
const operations = [map(x => x + x), filter(x => x < 100), mergeMap(n => timer(n))];
of(42).pipe(operations)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.