module Opal::TEA::Model

Overview

Core Model interface representing the state, update logic, and view in The Elm Architecture.

Defined in:

opal/tea/model.cr

Instance Method Summary

Instance Method Detail

abstract def init : Cmd #

Returns initial commands to execute upon application startup.


[View source]
def render(buffer : UI::Buffer) : Nil #

Optional direct buffer rendering for flicker-free double buffering


[View source]
abstract def update(msg : Msg) : Tuple(Model, Cmd) #

Updates the model state based on an incoming message, returning the new model and optional command.


[View source]
abstract def view : String #

Renders the current state as a formatted terminal string.


[View source]