An ORM-like library for managing entity relationships in NgRx applications built on top of @ngrx/entity and @ngrx/data. Current stable version: 1.7.1. Release cadence is intermittent with patch updates as needed. Key differentiators: provides a declarative API to define relationships (hasOne, hasMany, belongsTo) between entities, automatically resolves nested data, and integrates with @ngrx/entity selectors. It simplifies the boilerplate of normalizing and denormalizing relational data in the store. Supports Angular 12+ and RxJS 6+; TypeScript types are included. Alternative to manual selector composition or libraries like ngrx-normalizr.
npm install ngrx-entity-relationshipNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a root entity relationship with a hasMany relation and uses selectEntity to fetch it.
Define relationships outside of component class or use memoization techniques (e.g., store in a constant or use a factory with shared references).
Update to use adapter selectors provided by @ngrx/entity.
Replace selectEntitiesArray with selectEntities and map the result if needed.
Ensure the reducer for the entity state is created using the adapter's initial state (e.g., adapter.getInitialState()).
Check that the relationship name matches exactly the key in the rootEntity config object.
Add StoreModule.forRoot({}) to your imports or provide the store in standalone bootstrap.