You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimal reproduction of the bug/regression with instructions:
Use the | ngrxPush pipe with an observable typed differently than the @Input().
Expected behavior:
Error Type 'X' is not assignable to type 'Y'.
Actual behavior:
No type error in IDE or from ng build.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
Versions 11 and 12, not OS-specific.
Other information:
Copying the ngrxPush source code locally and experimenting, I've isolated it to this line. If export class PushPipe<S> ... is changed to export class PushPipe<S = any> ..., the type checking starts working.
Working from there, I confirmed that any pipe class with a generic argument is skipped in strict template checking. I created a Stackblitz to demonstrate the base issue, which seems specific to Angular, not NgRx. However, I couldn't find any related issues with Angular or otherwise.
Without understanding the need for this generic parameter, I'm not sure if this change is desirable. I noticed the Angular async pipe simply types the internal value as any, and does not use a generic on the class.
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:
Closes#3114
BREAKING CHANGES:
PushPipe no longer has a class-level generic type parameter.
BEFORE:
Use of PushPipe outside of component templates required a generic
AFTER:
Use of PushPipe outside of component templates no longer requires a generic
Minimal reproduction of the bug/regression with instructions:
Use the
| ngrxPush
pipe with an observable typed differently than the@Input()
.Expected behavior:
Error
Type 'X' is not assignable to type 'Y'.
Actual behavior:
No type error in IDE or from
ng build
.Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
Versions 11 and 12, not OS-specific.
Other information:
Copying the
ngrxPush
source code locally and experimenting, I've isolated it to this line. Ifexport class PushPipe<S> ...
is changed toexport class PushPipe<S = any> ...
, the type checking starts working.Working from there, I confirmed that any pipe class with a generic argument is skipped in strict template checking. I created a Stackblitz to demonstrate the base issue, which seems specific to Angular, not NgRx. However, I couldn't find any related issues with Angular or otherwise.
Without understanding the need for this generic parameter, I'm not sure if this change is desirable. I noticed the Angular async pipe simply types the internal value as
any
, and does not use a generic on the class.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: