package mosaic
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/mosaic.mlx/Mosaic_mlx/Cmd/index.html
Module Mosaic_mlx.CmdSource
Side-effects issued by the application.
Commands are values returned alongside a new model from app.init and app.update. The runtime executes them after each update cycle. Compose multiple commands with Cmd.batch.
type 'msg t = | None(*No command. Equivalent to
*)batch [].| Batch of 'msg t list(*Execute all commands in the list. Order is not guaranteed.
*)| Perform of ('msg -> unit) -> unit(*Execute an arbitrary side-effecting function. The function receives a dispatch callback and may call it zero or more times, from any thread. See
*)perform.| Quit(*Request orderly termination of the application.
*)| Set_title of string(*Set the terminal window title to the given string.
*)| Focus of string(*Move keyboard focus to the element identified by the given
*)id. Has no effect if no element carries thatid.| Static_commit of 'msg option Mosaic_ui.Vnode.t(*Render a vnode snapshot and write it to the static area with ANSI styling preserved. The row count is computed automatically from the rendered grid.
*)| Static_clear(*Clear all previously written static content.
*)
The type for commands.
batch cmds is a command that executes every command in cmds. Execution order among the commands is not specified.
perform f is a command that calls f dispatch asynchronously.
f may call dispatch msg any number of times; each call enqueues msg for the next update cycle. By default the runtime runs f on a fresh native thread so that long-running operations never block the UI loop. This behaviour can be overridden with the process_perform argument of run.
quit requests orderly application termination after the current update cycle completes.
focus id moves keyboard focus to the element whose id attribute equals id. Has no effect when no matching element exists.
static_commit view renders view offscreen at the current terminal width and appends the styled result to static output.