-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(signals): add prepend entity updaters #4721
feat(signals): add prepend entity updaters #4721
Conversation
✅ Deploy Preview for ngrx-io canceled.
|
Hi @dimavasylyna, Can you open a new GitHub issue (feature request) for this feature? Based on the community feedback, we'll decide if this feature should land and how it should be designed. You can find more info on this topic in our contribution guidelines: https://github.com/ngrx/platform/blob/main/CONTRIBUTING.md#submitting-new-features |
Hi @markostanimirovic, |
f03a19b
to
eea6adc
Compare
eea6adc
to
8b110e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @dimavasylyna! I left a few suggestions:
modules/signals/entities/spec/updaters/prepend-entities.spec.ts
Outdated
Show resolved
Hide resolved
be42877
to
9ece0a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The addEntity function in @ngrx/signals currently appends new entities to the end of the entities array by default. There is no way to control the insertion order, limiting flexibility in scenarios where entities need to be added at the beginning (e.g., for "most recent first" displays).
Closes #4723
What is the new behavior?
This PR adds new
prependEntity
andprependEntities
entity updaters for adding entities to the beginning of the collection.Example
Does this PR introduce a breaking change?