-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Typings startWith #5382
Comments
Not a bug, IMO. Without the explicit type argument, it should effect the correct type: of(true).pipe(startWith(undefined)); // Observable<boolean | undefined> If the explicit type parameter is specified, there is no way this can be satisfied, as |
It also doesn't work if you set the explicit type parameter to |
The answer is to not use an explicit type parameter - this is Google's own advice. Or, if one is to be specified, specify one that's compatible with the argument being passed: of(true).pipe(startWith<boolean | undefined>(undefined)); Not a bug, IMO. |
Even startWith(undefined as boolean|undefined) |
This is particularly annoying on |
Addressed in #6114 |
It seems like there is a bug in the typing for
startWith
.It seems like it is introduced with #5376
TS throws following error:
This occurs when ts is falling back to the following type signature of
startWith
:This could occur for example by doing the following:
In general, this problem occurred recently in G3 so it is at least some kind of breaking behavior
The text was updated successfully, but these errors were encountered: