Trying to implement a computed store feature #4451
-
I've defined the following store feature but when I use this within my store I get compile errors the first one of which is "No overload matches this call." as per usual the error reported is so huge it's very difficult to work out what the root of the problem is. As my store works with the withComputed added as a normal withComputed but then errors with that replaced with the below feature I assume there is something wrong with the code below.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 15 replies
-
OK it's being caused by the fact that I'm only passing in part of the state type, if I use the complete state type the error goes away i.e. My user state is made up of the following 3 elements, and my withResults feature only needs access to the
|
Beta Was this translation helpful? Give feedback.
-
If I change the feature creation function as below and then call the withResults like this
|
Beta Was this translation helpful? Give feedback.
Take a look: https://stackblitz.com/edit/github-8kstl6?file=state%2Ftest-store.ts
angular.json
is missing so the application cannot be started, but when dependencies are installed, error warnings will disappear intest-store.ts
when explicit generics are removed fromwithResults
andwithApplyFirst
.