ConsoleForge 0.3.0
Elm-architecture TUI framework for .NET 8
Loading...
Searching...
No Matches
ConsoleForge.Core.IModel Interface Reference

The root interface for all ConsoleForge application models. More...

Inheritance diagram for ConsoleForge.Core.IModel:

Public Member Functions

ICmdInit ()
 Called once at program start.
IWidget View ()
 Produce the root widget for the current model state.

Public Attributes

IModel Model
 Pure update function.

Detailed Description

The root interface for all ConsoleForge application models.

Implement this to define your application's state and behavior.

Member Function Documentation

◆ Init()

ICmd? ConsoleForge.Core.IModel.Init ( )

Called once at program start.

Return a command to execute on startup, or null for no initial side-effect.

◆ View()

IWidget ConsoleForge.Core.IModel.View ( )

Produce the root widget for the current model state.

The framework renders this widget using a persistent double-buffered context. Called after every Update. MUST be a pure, side-effect-free function.

Member Data Documentation

◆ Model

IModel ConsoleForge.Core.IModel.Model

Pure update function.

Given the current message, return the new model state and an optional follow-up command. Convention: return a new record copy (C# 'with' expression). MUST NOT return a null IModel.


The documentation for this interface was generated from the following file:
  • src/ConsoleForge/Core/IModel.cs