Program Module

Functions to enable the router in an Elmish program.

Functions and values

Function or value Description

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.