0Pricing
Angular Academy · Lesson

Entities and Custom Features

Manage collections with withEntities.

Managing Collections

Lists of records (todos, users, products) are so common that NgRx provides withEntities to manage them with normalized state and ready-made updater functions.

withEntities

withEntities stores items keyed by id in an entityMap plus an ordered ids array, and exposes an entities computed signal of the list.

import { withEntities } from '@ngrx/signals/entities';

export const TodoStore = signalStore(
  withEntities<Todo>()
);
// store.entities() -> Todo[]

All lessons in this course

  1. Creating a SignalStore
  2. Computed and Methods
  3. rxMethod for Async Work
  4. Entities and Custom Features
← Back to Angular Academy