NgRx Entity
- Part of NgRx
- Converts arrays to dictionaries
- Supports relationships between stores
- Super fast find by id
- Entity enrichment
- Loading, error, etc
- Selectors to transform data back to arrays
interface EntityState<V> {
ids: string[] | number[];
entities: { [id: string | id: number]: V };
}
- Memoized
- Composable
- Testable
Refactor Tour of Heroes NgRx project to use entity: https://stackblitz.com/github/jessesanders/tour-of-heroes/tree/ngrx
Last modified 3yr ago