Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Path-based dispatching for js_of_ocaml applications.
Dispatch_js makes it easy for js_of_ocaml applications to monitor and react to changes in URI fragments.
val dispatch_on_fragment :
?on_failure:(string -> unit Lwt.t) ->
?default:string ->
unit Lwt.t Dispatch.t ->
unit Lwt.t
dispatch_on_fragment ?on_failure ?default routes
will monitor the URL fragment and dispatch to the appropriate hander in routes
. In the event that the fragment does not match any routes, on_failure
will be called, if provided, with the fragment. On setup the fragment will be set to default
, or "/"
if no default is provided.