ngrx-workshop
Search…
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

Entity State

1
interface EntityState<V> {
2
ids: string[] | number[];
3
entities: { [id: string | id: number]: V };
4
}
Copied!

Reducers

Selectors

  • Memoized
  • Composable
  • Testable
Refactor Tour of Heroes NgRx project to use entity: https://stackblitz.com/github/jessesanders/tour-of-heroes/tree/ngrx
Last modified 2yr ago