briebug / ngrx-auto-entity

NgRx Auto-Entity: Simplifying Reactive State
https://briebug.gitbook.io/ngrx-auto-entity/
Other
66 stars 12 forks source link

Unable to find entity states for optional loading if states are created with `buildFeatureState` #208

Closed jrista closed 2 years ago

jrista commented 2 years ago

The optional loading operators were originally designed to work with standard entity states, rooted in the root state object. If entity states created under feature state buckets are used, the optional loading operators are unable to find the states in their feature child object.

The root state getter function for optional loading operators needs to be updated to check if the entity has feature affinity or not. If an entity does have feature affinity, it needs to look for the state on the feature, otherwise look for the state in the root.