Library
Module
Module type
Parameter
Class
Class type
include module type of React.S
val trace : ?iff:bool t -> ('a -> unit) -> 'a React.signal -> 'a React.signal
module Bool : sig ... end
module Int : sig ... end
module Float : sig ... end
module Pair : sig ... end
module Option : sig ... end
module Compare : sig ... end
module type EqType = sig ... end
module type S = sig ... end
module Special : sig ... end
val return : 'a -> 'a signal
Same as const
.
bind ?eq s f
is initially f x
where x
is the current value of s
. Each time s
changes to a new value y
, bind
signal f
is set to f y
, until the next change of signal
.
Same as bind
except that f
returns a promise. Calls to f
are serialized.
with_finaliser f s
returns a signal s'
which behaves as s
, except that f
is called when s'
is garbage collected.
limit f s
limits the rate of s
update with f
.
For example, to limit it to 1 per second, you can use: limit
(fun () -> Lwt_unix.sleep 1.0) s
.
val keep : 'a signal -> unit
keep s
keeps a reference to s
so it will never be garbage collected.
The following functions behave as their React
counterpart, except that they take functions that may yield.
The _s
suffix means that calls are serialized.