Logo Mibo

HeadlessProgram<'Model, 'Msg> Type

A program configuration for running the Elmish update loop without graphics.

HeadlessProgram shares the core Elmish architecture (Init, Update, Subscribe, Tick, FixedStep) with the full Program type, but excludes renderers and window configuration. Use HeadlessProgram.mkHeadless to create one.

Record fields

Record Field Description

DispatchMode

Full Usage: DispatchMode

Field type: DispatchMode

Controls when dispatched messages become eligible for processing.

Field type: DispatchMode

FixedStep

Full Usage: FixedStep

Field type: FixedStepConfig<'Msg> voption

Optional framework-managed fixed timestep configuration.

Field type: FixedStepConfig<'Msg> voption

Init

Full Usage: Init

Field type: GameContext -> 'Model * Cmd<'Msg>

Creates initial model and commands when the headless runner starts.

Field type: GameContext -> 'Model * Cmd<'Msg>

Observers

Full Usage: Observers

Field type: (unit -> IObserver<GameContext * 'Model * GameTime>) list

Observer factories for receiving model snapshots each frame.

Field type: (unit -> IObserver<GameContext * 'Model * GameTime>) list

Profiler

Full Usage: Profiler

Field type: FrameProfiler voption

Optional frame profiler. Set via HeadlessProgram.withProfiler.

When unset, the runner measures nothing.

Field type: FrameProfiler voption

Subscribe

Full Usage: Subscribe

Field type: GameContext -> 'Model -> Sub<'Msg>

Returns subscriptions based on current model state.

Field type: GameContext -> 'Model -> Sub<'Msg>

Tick

Full Usage: Tick

Field type: (GameTime -> 'Msg) voption

Optional function to generate a message each frame.

Field type: (GameTime -> 'Msg) voption

Update

Full Usage: Update

Field type: 'Msg -> 'Model -> 'Model * Cmd<'Msg>

Handles messages and returns updated model and commands.

Field type: 'Msg -> 'Model -> 'Model * Cmd<'Msg>

UpdateCtx

Full Usage: UpdateCtx

Field type: (GameContext -> 'Msg -> 'Model -> 'Model * Cmd<'Msg>) voption

Optional context-aware update. When set, the runner calls this instead of HeadlessProgram, passing the GameContext the runner owns.

Set via HeadlessProgram.mkHeadlessCtx.

Field type: (GameContext -> 'Msg -> 'Model -> 'Model * Cmd<'Msg>) voption

Type something to start searching.