platform
platform copied to clipboard
EntityAdapter.getSelectors(selectState) has wrong typing
Minimal reproduction of the bug/regression with instructions:
https://stackblitz.com/edit/ngrx-seed-wyr8ke?file=src%2Fapp%2Freducers%2Fusers.reducer.ts
At line 22 of app/reducers/users.reducer.ts
of the above StackBlitz, the typing of the users
selector is (state: UsersAppState) => Users[]
. This isn't a big issue with applications, but is most notable in unit tests because MockStore.overrideSelector()
requires a MemoizedSelector
.
Expected behavior:
The typing of the users
selector should be MemoizedSelector<UsersAppState, User[], DefaultProjectorFn<User[]>>
when passing a selectState
selector.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
NgRx: 10.0.0 Angular: n/a
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
Same pb here when trying to use the MemoizedSelector.projector
in tests.
Is there anything we can do to help get this PR merged ? It would be nice to finally have those types fixed.
Last time the ngrx team aimed to allow the overrideSelector to accept non memoized selector as well instead of adjusting the getSelectors. https://github.com/ngrx/platform/pull/2502
I hope someone can get it done this time - fingers crossed :)
Hi, as mentioned in #2978 the docs don't link to the correct interface. I'll gladly update this PR with some update to the docs, but I can't find how to update it. Could someone point me in the good direction ? 😄
Hi, as mentioned in https://github.com/ngrx/platform/issues/2978 the docs don't link to the correct interface. I'll gladly update this PR with some update to the docs, but I can't find how to update it. Could someone point me in the good direction ? smile
Bump this issue for the documentation error.