elmish-browser


Routing and navigation for browser apps

This library helps you turn URLs into nicely structured data, handle browser address change events and manipulate browser history directly.

Installation

1: 
paket add nuget Fable.Elmish.Browser

Routing

Intercept browser address changes and feed them into the dispatch loop.

Usage:

1: 
2: 
3: 
4: 
5: 
open Elmish.Browser.Navigation

Program.mkProgram init update view
|> Program.toNavigable parser urlUpdate
|> Program.run

For more information see the routing tutorial.

Navigation

Manipulate the browser's navigation and history.

Usage:

1: 
2: 
3: 
4: 
open Elmish.Browser.Navigation

let update model msg =
    model, Navigation.newUrl "some_other_location"

For details see the Navigation module.

namespace Elmish
namespace Elmish.Browser
namespace Elmish.Browser.Navigation
Multiple items
module Program

from Elmish.Browser.Navigation

--------------------
module Program

from Elmish

--------------------
type Program<'arg,'model,'msg,'view> =
  {init: 'arg -> 'model * Cmd<'msg>;
   update: 'msg -> 'model -> 'model * Cmd<'msg>;
   subscribe: 'model -> Cmd<'msg>;
   view: 'model -> Dispatch<'msg> -> 'view;
   setState: 'model -> Dispatch<'msg> -> unit;
   onError: string * exn -> unit;}

Full name: Elmish.Program<_,_,_,_>
val mkProgram : init:('arg -> 'model * Cmd<'msg>) -> update:('msg -> 'model -> 'model * Cmd<'msg>) -> view:('model -> Dispatch<'msg> -> 'view) -> Program<'arg,'model,'msg,'view>

Full name: Elmish.Program.mkProgram
val run : program:Program<unit,'model,'msg,'view> -> unit

Full name: Elmish.Program.run
val update : model:'a -> msg:'b -> 'a * Cmd<'c>

Full name: Index.update
val model : 'a
val msg : 'b
module Navigation

from Elmish.Browser.Navigation
val newUrl : newUrl:string -> Cmd<'a>

Full name: Elmish.Browser.Navigation.Navigation.newUrl