Module Lwt_react.​S

module S : sig..end

include React.S
Monadic interface
val return : 'a -> 'a Lwt_react.signal

Same as const.

val bind : 
  ?eq:('a -> 'a -> bool) ->
  'b Lwt_react.signal ->
  ('b -> 'a Lwt_react.signal) -> 'a Lwt_react.signal

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.

val bind_s : 
  ?eq:('a -> 'a -> bool) ->
  'b Lwt_react.signal ->
  ('b -> 'a Lwt_react.signal Lwt.t) -> 'a Lwt_react.signal Lwt.t

Same as Lwt_react.​S.​bind except that f returns a thread. Calls to f are serialized.

Lwt-specific utilities
val with_finaliser : 
  (unit -> unit) -> 'a Lwt_react.signal -> 'a Lwt_react.signal

with_finaliser f s returns a signal s' which behave as s, except that f is called when s' is garbage collected.

val limit : 
  ?eq:('a -> 'a -> bool) ->
  (unit -> unit Lwt.t) -> 'a Lwt_react.signal -> 'a Lwt_react.signal

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 Lwt_react.signal -> unit

keep s keeps a reference to s so it will never be garbage collected.

Threaded versions of React transformation functions

The following functions behave as their React counterpart, except that they takes functions that may yield.

The _s suffix means that calls are serialized.

val app_s :