Program Module

Functions to enable the router in an Elmish program.

Functions and values

Function or value Description

mkSimpleStreamRendering initialModel load update view

Full Usage: mkSimpleStreamRendering initialModel load update view

Parameters:
    initialModel : 'model - The model that is shown initially.
    load : 'model -> Task<'model> - Load the model to be stream-rendered.
    update : 'msg -> 'model -> 'model - The Elmish update function.
    view : 'model -> Dispatch<'msg> -> Node - The Elmish view function.

Returns: Program<'model, 'msg>

Create a simple program for a component that uses StreamRendering.

initialModel : 'model

The model that is shown initially.

load : 'model -> Task<'model>

Load the model to be stream-rendered.

update : 'msg -> 'model -> 'model

The Elmish update function.

view : 'model -> Dispatch<'msg> -> Node

The Elmish view function.

Returns: Program<'model, 'msg>

mkStreamRendering initialModel load update view

Full Usage: mkStreamRendering initialModel load update view

Parameters:
    initialModel : 'model - The model that is shown initially.
    load : 'model -> Task<'model * Cmd<'msg>> - Load the model to be stream-rendered.
    update : 'msg -> 'model -> 'model * Cmd<'msg> - The Elmish update function.
    view : 'model -> Dispatch<'msg> -> Node - The Elmish view function.

Returns: Program<'model, 'msg>

Create a program for a component that uses StreamRendering.

initialModel : 'model

The model that is shown initially.

load : 'model -> Task<'model * Cmd<'msg>>

Load the model to be stream-rendered.

update : 'msg -> 'model -> 'model * Cmd<'msg>

The Elmish update function.

view : 'model -> Dispatch<'msg> -> Node

The Elmish view function.

Returns: Program<'model, 'msg>

withRouter router program

Full Usage: withRouter router program

Parameters:
    router : IRouter<'model, 'msg> - The router.
    program : Program<'model, 'msg> - The Elmish program.

Returns: Program<'a, 'model, 'msg, Node> The Elmish program configured with routing.

Attach `router` to `program` when it is run as the `Program` of a `ProgramComponent`.

router : IRouter<'model, 'msg>

The router.

program : Program<'model, 'msg>

The Elmish program.

Returns: Program<'a, 'model, 'msg, Node>

The Elmish program configured with routing.

withRouterInfer makeMessage getEndPoint program

Full Usage: withRouterInfer makeMessage getEndPoint program

Parameters:
    makeMessage : 'ep -> 'msg - Function that creates a message from an endpoint value.
    getEndPoint : 'model -> 'ep - Function that extracts the current endpoint from the model.
    program : Program<'model, 'msg> - The Elmish program.

Returns: Program<'a, 'model, 'msg, Node> The Elmish program configured with routing.

Attach a router inferred from `makeMessage` and `getEndPoint` to `program` when it is run as the `Program` of a `ProgramComponent`.

makeMessage : 'ep -> 'msg

Function that creates a message from an endpoint value.

getEndPoint : 'model -> 'ep

Function that extracts the current endpoint from the model.

program : Program<'model, 'msg>

The Elmish program.

Returns: Program<'a, 'model, 'msg, Node>

The Elmish program configured with routing.