Skip to main content
The Todos example demonstrates how to build a full-featured list application using TCA. It showcases collections, bindings, filtering, and coordinated animations.

Overview

This example shows how to:
  • Manage collections of child features with forEach
  • Use @Bindable for two-way bindings
  • Filter and transform state for views
  • Coordinate animations with effects
  • Handle list operations (add, delete, move)

Implementation

Key Concepts

Collections with forEach

The forEach operator manages a collection of child features:
This automatically:
  • Runs the Todo reducer for each element
  • Routes actions to the correct todo by ID
  • Maintains independent state for each todo

IdentifiedArray

IdentifiedArrayOf provides efficient collection management:

Bindings

BindingReducer enables two-way bindings:
In the view:

Computed State

Derived state for filtering:
Scope to filtered todos in the view:

Coordinated Animations

Delay sorting to allow animations to complete:

Observing Child Actions

The parent observes when a todo is completed and schedules sorting:

Testing

Source Code

View the complete example in the TCA repository:

Next Steps