This is client API (go to server)

Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Module Ot_spinner

module Ot_spinner : sig..end

Spinner widget


val with_spinner : 
  ?a:[< Html_types.div_attrib ] Eliom_content.Html.attrib list ->
  ?fail:(exn ->
   [< Html_types.div_content ] Eliom_content.Html.elt list Lwt.t) ->
  [< Html_types.div_content ] Eliom_content.Html.elt list Lwt.t ->
  [> `Div ] Eliom_content.Html.elt Lwt.t

On client side, with_spinner th returns immediately a spinner while Lwt thread th is not finished, that will automatically be replaced by the result of th when finished. It has class "spinning" while the spinner is present.

On server side, it will wait for th to be finished before returning its result (and never display a spinner).

If you want the spinner on both sides, you can use with_spinner_no_lwt and Eliom_content.Html.C.node.

val with_spinner_no_lwt : 
  ?a:[< Html_types.div_attrib ] Eliom_content.Html.attrib list ->
  ?fail:(exn -> [< Html_types.div_content ] Eliom_content.Html.elt list) ->
  [< Html_types.div_content ] Eliom_content.Html.elt list Lwt.t ->
  [> `Div ] Eliom_content.Html.elt

Same as with_spinner but returns immediately. Client only (as we must wait for the thread to terminate on server before sending the page).

val num_active_spinners : int Eliom_shared.React.S.t

the number of spinners currently spinning

onloaded is an event that fires when all spinners have finished loading. This can occur multiple times.

val onloaded : unit Eliom_shared.React.E.t

do an action once no spinners are spinning (could be right away)

val when_loaded : (unit -> unit) -> unit