Program Module
Functions and values
| Function or value |
Description
|
|
|
|
|
|
|
Full Usage:
mkProgram init update view
Parameters:
'Arg -> 'Model * Cmd<'Msg>
update : 'Msg -> 'Model -> 'Model * Cmd<'Msg>
view : IObservable<'Model> -> Dispatch<'Msg> -> 'View
Returns: Program<'Arg, 'Model, 'Msg, 'View>
Type parameters: 'Arg, 'Model, 'Msg, 'View |
|
Full Usage:
mkSimple init update view
Parameters:
'Arg -> 'Model
update : 'Msg -> 'Model -> 'Model
view : IObservable<'Model> -> Dispatch<'Msg> -> 'View
Returns: Program<'Arg, 'Model, 'Msg, 'View>
Type parameters: 'Arg, 'Model, 'Msg, 'View |
|
Full Usage:
onError program
Parameters:
Program<'Arg, 'Model, 'Msg, 'View>
Returns: string * exn -> unit
Type parameters: 'Arg, 'Model, 'Msg, 'View |
Get the current error handler.
|
Full Usage:
run program
Parameters:
Program<unit, 'Model, 'Msg, 'View>
Returns: 'View
Type parameters: 'Model, 'Msg, 'View |
Start the dispatch loop with 'unit' for the init() function.
|
Full Usage:
runWith arg program
Parameters:
'Arg
program : Program<'Arg, 'Model, 'Msg, 'View>
Returns: 'View
Type parameters: 'Arg, 'Model, 'Msg, 'View |
Start the program and return the view. The program runs until its termination message arrives; to stop it externally, use runWithLifecycle and dispose the returned handle.
|
Full Usage:
runWithLifecycle arg program
Parameters:
'Arg
program : Program<'Arg, 'Model, 'Msg, 'View>
Returns: 'View * IDisposable
Type parameters: 'Arg, 'Model, 'Msg, 'View |
Start the program and return the view plus its lifetime handle: disposing the handle stops subscriptions, completes the model stream, and stops the update loop. Disposing twice is a no-op. Prefer calling Dispose on the UI thread. Controls bound to the model stream revert to their default property values when the stream completes.
|
Full Usage:
runWithLifetime visual arg program
Parameters: Returns: 'View * IDisposable
Type parameters: 'Arg, 'Model, 'Msg, 'View |
Start the program bound to a visual's tree lifetime: the returned handle stops the program when the visual first detaches from the visual tree. Re-attaching does not restart it; run a new program instead. For visuals that detach and reattach by design (cached tabs), use runWithLifecycle and own the disposal yourself.
|
|
|
|
|
|
Register the subscription set for the program, replacing any existing one. 'subscribe' runs with every new model; the engine starts and stops subscriptions to match what it returns.
|
|
Set the exit criteria and the handler, replacing any existing termination. A message matching the predicate terminates the program: subscriptions stop, the model stream completes, and the handler runs with the final model.
|
|
MVUish.Avalonia