Skip to content

Comments

fix(entity): infer selectId return type from adapter configuration#5085

Open
timdeschryver wants to merge 3 commits intomainfrom
issues/5073
Open

fix(entity): infer selectId return type from adapter configuration#5085
timdeschryver wants to merge 3 commits intomainfrom
issues/5073

Conversation

@timdeschryver
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #5073

The IdSelector always returned string | number.

What is the new behavior?

The return type if inferred by the adapter:

  • uses the id property of the state
  • uses the return type of the selectId method, if provided in the config options

Does this PR introduce a breaking change?

I'm also ok with flagging this as a breaking change.

[ ] Yes
[x] No

Other information

@netlify
Copy link

netlify bot commented Feb 7, 2026

Deploy Preview for ngrx-io ready!

Name Link
🔨 Latest commit 73e01eb
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-io/deploys/69936abb3374ab00096f2e8c
😎 Deploy Preview https://deploy-preview-5085--ngrx-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 16, 2026

Deploy Preview for ngrx-site-v21 ready!

Name Link
🔨 Latest commit 73e01eb
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-site-v21/deploys/69936abb5a468d00087858f2
😎 Deploy Preview https://deploy-preview-5085--ngrx-site-v21.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

/**
* Creates an entity adapter with methods for managing collections of entities in state.
*
* @description
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: add breaking change note to commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Entity] Expose IdSelectorNum and IdSelectorStr types for better type safety

1 participant