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
I think if we would log (or even throw) a message when selectId returns an undefined when using Entity module, it would increase the dev experience.
Note that this would only be done when the application is in dev mode.
This message could be something like "ngrx/entity: the key 'id' does not exist in {...}, you can provide your own key with selectId." where id is the return value of selectId. The second part would only be needed if the developer doesn't override the default function.
Describe any alternatives/workarounds you're currently using
Now the developer has to figure out why the ids in the store are all undefined.
Other information:
This idea came after a question and discussion with @sandangel on the gitter channel.
If accepted, I would be willing to submit a PR for this feature
[X] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
The text was updated successfully, but these errors were encountered:
My idea is extending the capabilities of ngrx/entity by allowing non-unique items in entities. If the id property was not provided, we can add id property = index and entities will look something like this:
I think if we would log (or even throw) a message when
selectId
returns anundefined
when using Entity module, it would increase the dev experience.Note that this would only be done when the application is in dev mode.
This message could be something like "ngrx/entity: the key 'id' does not exist in {...}, you can provide your own key with
selectId
." whereid
is the return value ofselectId
. The second part would only be needed if the developer doesn't override the default function.Describe any alternatives/workarounds you're currently using
Now the developer has to figure out why the ids in the store are all
undefined
.Other information:
This idea came after a question and discussion with @sandangel on the gitter channel.
If accepted, I would be willing to submit a PR for this feature
[X] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
The text was updated successfully, but these errors were encountered: