Header menu 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

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>

Type something to start searching.