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

interface EntityState<V> {
ids: string[] | number[];
entities: { [id: string | id: number]: V };
}

Reducers

Selectors

  • Memoized

  • Composable

  • Testable

Refactor Tour of Heroes NgRx project to use entity: https://stackblitz.com/github/jessesanders/tour-of-heroes/tree/ngrx‚Äč