dispatch
Path-based dispatching for client- and server-side applications.
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type 'a route = string * ( assoc -> string option -> 'a )
The type of a route using the DSL to specify the path pattern. For example, here are some DSL strings and their translation:
# of_dsl "/";; = ([], `Exact) # of_dsl "/user/:id";; = ([`Lit, "user"; `Var, "id"], `Exact) # of_dsl "/user/:id/*";; = ([`Lit, "user"; `Var, "id"], `Prefix) # of_dsk "/user/:id/settings";; = ([`Lit, "user"; `Var, "id"; `Lit, "settings"], `Exact)
val dispatch : 'a route list -> string -> ( 'a, string ) Result.result
val dispatch_exn : 'a route list -> string -> 'a