HomeChallengesRepsProblemsLeaderboardTake a challenge

A Signal Store

A service holding shared state in signals, with an optimistic update that rolls back exactly when the request fails. This is the stage that separates people who have read about signals from people who have shipped them.

Advanced30 min on the clock5 graded checks · 100 pointsAngular SprintPro

See alsoA store without a libraryThe same store in React, built from context and a reducer rather than signals.

Graded by reading your code against the checklist below.

What you build

  • Keep the writable signal private and expose it readonly
  • Derive the remaining count rather than storing it
  • Update the UI before the request, not after
  • Snapshot the previous state and restore it on failure
  • Update immutably — new objects, not mutated ones

Done means

The checkbox flips instantly; when the request fails it flips back and an error appears.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. Expose the state readonly+20Objects that protect themselves
  2. Update before the request, not after+25Loading and error states
  3. Roll back to the exact snapshot on failure+25Error handling
  4. Derive the count rather than storing it+15Angular signals
  5. Update immutably+15Not mutating your inputs

What it teaches

Angular signalsintermediate

A signal is a value that tells the template when it changed, so Angular updates only what actually depends on it — and computed() derives from other signals rather than storing a second copy that can drift.

The rest of Angular Sprint