feat: add withEntityResources for managing entity state and resources#243
Merged
rainerhahnekamp merged 3 commits intoOct 21, 2025
Merged
Conversation
rainerhahnekamp
approved these changes
Oct 20, 2025
Collaborator
rainerhahnekamp
left a comment
There was a problem hiding this comment.
very good. just tiny things. if you want we can merge now, and you do the 3 tasks in a separate branch.
rainerhahnekamp
requested changes
Oct 20, 2025
Collaborator
rainerhahnekamp
left a comment
There was a problem hiding this comment.
Sorry, there are some conflicts, Can you maybe rebase from main?
01d5a15 to
16b7f3c
Compare
rainerhahnekamp
approved these changes
Oct 21, 2025
Collaborator
|
Danke Murat! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
withEntityResources()to integrate Angular Resources that return arrays with NgRx Entities in SignalStore. It composes resource handling with entity helpers, keeps entity state linked to the resource value via linked signals, and supports both unnamed and named collections.withEntityResources()libs/ngrx-toolkitwithEntityResources- Resources & Entities together #236Motivation
Many resources represent collections. Previously, wiring
withResourceresults intowithEntitiesrequired boilerplate and manual sync. This feature removes redundancy by linking entity state to the resource value directly.Design Overview
withResource(); derivesids,entityMap, andentitiesfrom the resource’svalue.idcompatible withEntityId).Usage
Unnamed
Named
Entity Updaters
Implementation Notes
libs/ngrx-toolkit/src/lib/with-entity-resources.tswith unit tests.libs/ngrx-toolkit/src/index.ts.docs/docs/with-entity-resources.mdand sidebar updated.apps/demo/src/app/todo-entity-resource/*with an E2E test.Tests & Demo
libs/ngrx-toolkit/src/lib/with-entity-resources.spec.tsapps/demo/src/app/todo-entity-resource/*apps/demo/e2e/todo-entity-resource.spec.tsDocumentation
withEntityResources()usage, inputs, and examples.docs/docs/extensions.mdanddocs/sidebars.ts.Breaking Changes
Checklist