Adding State
By the end of this guide, you will:
-
Define a Model using
Data.defineto hold your app state -
Explain why state is stored in a struct, not instance variables
-
Pass the Model to your VIEW function
-
Display dynamic content based on state
-
Use
model.with(...)to create updated state immutably -
Use predicate helpers (
.up?,.down?,.j?,.k?) for key checks -
Use pattern matching (
case message) for complex message handling -
Return a new Model from UPDATE with state changes
-
Navigate your file browser with arrow keys and vim keys
-
Understand when to use predicates vs pattern matching
⚠️ This page is a stub. Help us write it! See the Documentation Plan and Style Guide.