-
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.
chore: fix iif typings to infer never (#5176)
* chore(typings): fix iif observable typings for optional parameters (#4494) * test(dtslint): add dtslint test for iif observable static function (#4093) * chore: remove unnecessary signature * chore: fix dtslint expectations Closes #4494 * chore: empty commit to kick CI
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { iif, of } from 'rxjs'; | ||
|
||
it('should accept function as first parameter', () => { | ||
const a = iif(() => false); // $ExpectType Observable<never> | ||
}); | ||
|
||
it('should infer correctly with 2 parameters', () => { | ||
const a = iif(() => false, of(1)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should infer correctly with 3 parameters', () => { | ||
const a = iif(() => false, of(1), of(2)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should infer correctly with 3 parameters of different types', () => { | ||
const a = iif(() => false, of(1), of('a')); // $ExpectType Observable<string | number> | ||
}); |
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