-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ngrxPush pipe returns undefined, type is not correct #2888
Comments
Seems like a good change to me. |
Angular team acknowledges that
Since this is new in ngrx and there shouldn't be so many compatibility concerns as with Angular, I'd say to go with Besides those comments form the Angular issues, I personally would prefer it for an additional reason. The pipe is used mainly at inputs, and having as empty value <my-comp [value]="value$ | ngrxPush"> @Input() value?: string;
// Instead of
@Input() value: string | null; |
Thanks for the clarification @samuelfernandez |
PR created, ready to be reviewed |
) BREAKING CHANGE: BEFORE: ngrxPush typing doesn't consider `undefined` when the input type is an observable AFTER: ngrxPush typing considers `undefined` when the input type is an observable Closes #2888
Minimal reproduction of the bug/regression with instructions:
https://stackblitz.com/edit/angular-ivy-9bbbxq?file=src/app/app.component.html
Expected behavior:
Right now the typing of the pipe is:
https://github.com/ngrx/platform/blob/master/modules/component/src/push/push.pipe.ts#L82
However, if the source doesn't emit on subscription, the first returned value will be
undefined
.A more strict and real typing would be:
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
@angular: ^11.0.8
@ngrx/component: ^10.1.2
Other information:
I would be willing to submit a PR to fix this issue
[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
The text was updated successfully, but these errors were encountered: