Skip to main content

Crate teatui

Crate teatui 

Source
Expand description

Elm-like framework implemented on top of Ratatui.

The state of your application is represented by a single type called the Model.

The Model will be used by a view process to render a View.

A separate process will read events from the outside world and send them to an update process.

The update process will take the model and an event and return a new model, potentially also returning a side effect.

The updated model will be sent to the view, triggering a new render based on the new state of the application.

If any side effects are returned from update, they will be processed in a separate process.

If the process responsible for handling side effects wants to update the state of the application, it will send a message to the update process.

The users of this framework only need to provide:

  • An update function that given a model and a message return an Update instance.

  • A view function that given a reference to the model, returns a View

  • An effects function that given a reference to the model and an effect, might perform any side effects and optionally return a message to update the state of the application

§Examples

You can find a folder with example projects in the examples folder.

Modules§

effects
Actor responsible of processing side effects sent by the update actor.
events
Actor responsible of reading terminal input events.
update
Actor responsible of maintaining the state of the application.
view
Actor responsible of rendering the model into the terminal.

Enums§

ProgramError

Functions§

start
Starts the runtime which manages all the internal processes and message passing.