Capstone: Typed Todo Engine

Combine classes, Maps, closures, immutable updates, interfaces, unions, and generics into a complete in-memory todo store.

Step 1 of 6

Build a typed in-memory todo store

This capstone exercises everything from the module:

  • Interface for the Todo shape, with a literal-string union for priority.
  • Type alias for an optional filter shape using indexed access.
  • Map as the underlying store for O(1) lookup by id.
  • Closure to keep the Map private inside createStore.
  • Immutable updates when toggling a todo (no in-place mutation).
  • Generic find<K extends keyof Todo> for typesafe lookups by any field.
  • === only for comparisons.

Take it one step at a time. Each step builds on the previous one.