Flow
Here’s what we want to happen when a user clicks that ‘Increase’ button:
sequenceDiagram
participant View
participant Runtime
participant Update
View->>Runtime: ChangeCount
Runtime->>Update: ChangeCount and Current Model
Update-->>Runtime: (Updated model, Commands)
Runtime->>View: Updated model
- The View generates a message, ChangeCount
- The Elm runtime calls our Update function with the message and the current model
- Update returns an updated model and commands to run
- The Elm runtime renders the View again with the updated model