-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: combineLatestWith and zipWith infer types from n-arguments (#5257)
* refactor: use renamed ObservedValueUnionFromArray * fix: use non-union n-args combineLatestWith sig * fix: use non-union n-args zipWith sig * chore: kick CI ... again
- Loading branch information
Showing
5 changed files
with
67 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { of } from 'rxjs'; | ||
import { zipWith } from 'rxjs/operators'; | ||
|
||
describe('zipWith', () => { | ||
describe('without project parameter', () => { | ||
it('should infer correctly with 1 param', () => { | ||
const a = of(1, 2, 3); | ||
const b = of('a', 'b', 'c'); | ||
const res = a.pipe(zipWith(b)); // $ExpectType Observable<[number, string]> | ||
}); | ||
|
||
it('should infer correctly with 2 params', () => { | ||
const a = of(1, 2, 3); | ||
const b = of('a', 'b', 'c'); | ||
const c = of('d', 'e', 'f'); | ||
const res = a.pipe(zipWith(b, c)); // $ExpectType Observable<[number, string, string]> | ||
}); | ||
|
||
it('should infer correctly with 3 params', () => { | ||
const a = of(1, 2, 3); | ||
const b = of('a', 'b', 'c'); | ||
const c = of('d', 'e', 'f'); | ||
const d = of('g', 'h', 'i'); | ||
const res = a.pipe(zipWith(b, c, d)); // $ExpectType Observable<[number, string, string, string]> | ||
}); | ||
|
||
it('should infer correctly with 4 params', () => { | ||
const a = of(1, 2, 3); | ||
const b = of('a', 'b', 'c'); | ||
const c = of('d', 'e', 'f'); | ||
const d = of('g', 'h', 'i'); | ||
const e = of('j', 'k', 'l'); | ||
const res = a.pipe(zipWith(b, c, d, e)); // $ExpectType Observable<[number, string, string, string, string]> | ||
}); | ||
|
||
it('should infer correctly with 5 params', () => { | ||
const a = of(1, 2, 3); | ||
const b = of('a', 'b', 'c'); | ||
const c = of('d', 'e', 'f'); | ||
const d = of('g', 'h', 'i'); | ||
const e = of('j', 'k', 'l'); | ||
const f = of('m', 'n', 'o'); | ||
const res = a.pipe(zipWith(b, c, d, e, f)); // $ExpectType Observable<[number, string, string, string, string, string]> | ||
}); | ||
|
||
it('should accept N params', () => { | ||
const a = of(1, 2, 3); | ||
const b = of('a', 'b', 'c'); | ||
const c = of('d', 'e', 'f'); | ||
const d = of('g', 'h', 'i'); | ||
const e = of('j', 'k', 'l'); | ||
const f = of('m', 'n', 'o'); | ||
const g = of('p', 'q', 'r'); | ||
const res = a.pipe(zipWith(b, c, d, e, f, g)); // $ExpectType Observable<[number, string, string, string, string, string, string]> | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters