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

Module Eliom_shared.React.S

module S : sig..end

include Eliom_shared_sigs.S
val create : 
  ?default:('a React.S.t * (?step:React.step -> 'a -> unit)) option
   Eliom_client_value.t ->
  ?reset_default:bool ->
  ?eq:('a -> 'a -> bool) Value.t ->
  'a -> 'a t * (?step:React.step -> 'a -> unit) Value.t

create ?default ?reset_default x produces a pair s, f, where s is a (shared) reactive signal, and f is a shared function for updating the signal.

The initial value of the signal is x, unless default is provided. default, if provided, is used as the client-side signal. reset_default, if set to true (default: false), resets the value of default to x.

The behavior of f is undefined on the server side. On the client side, f behaves just like the standard React-provided update functions.

val synced : 'a t -> bool

If synced s is true, then the server-side and client-side values of s are equal. This means that the client-side code can initially rely on the server-provided value, and defer updates until the first client-side update of s.