include module type of React.E
type 'a t = 'a React.event
val never : 'a React.event
val create : unit -> 'a React.event * (?step:React.step -> 'a -> unit)
val retain : 'a React.event -> (unit -> unit) -> [ `R of unit -> unit ]
val stop : ?strong:bool -> 'a React.event -> unit
val equal : 'a React.event -> 'a React.event -> bool
val trace :
?iff:bool React.signal ->
('a -> unit) ->
'a React.event ->
'a React.event
val once : 'a React.event -> 'a React.event
val drop_once : 'a React.event -> 'a React.event
val app : ('a -> 'b) React.event -> 'a React.event -> 'b React.event
val map : ('a -> 'b) -> 'a React.event -> 'b React.event
val stamp : 'b React.event -> 'a -> 'a React.event
val filter : ('a -> bool) -> 'a React.event -> 'a React.event
val fmap : ('a -> 'b option) -> 'a React.event -> 'b React.event
val diff : ('a -> 'a -> 'b) -> 'a React.event -> 'b React.event
val changes : ?eq:('a -> 'a -> bool) -> 'a React.event -> 'a React.event
val on : bool React.signal -> 'a React.event -> 'a React.event
val when_ : bool React.signal -> 'a React.event -> 'a React.event
val dismiss : 'b React.event -> 'a React.event -> 'a React.event
val until : 'a React.event -> 'b React.event -> 'b React.event
val accum : ('a -> 'a) React.event -> 'a -> 'a React.event
val fold : ('a -> 'b -> 'a) -> 'a -> 'b React.event -> 'a React.event
val select : 'a React.event list -> 'a React.event
val merge : ('a -> 'b -> 'a) -> 'a -> 'b React.event list -> 'a React.event
val switch : 'a React.event -> 'a React.event React.event -> 'a React.event
val fix : ('a React.event -> 'a React.event * 'b) -> 'b
val l1 : ('a -> 'b) -> 'a React.event -> 'b React.event
val l2 : ('a -> 'b -> 'c) -> 'a React.event -> 'b React.event -> 'c React.event
val l3 :
('a -> 'b -> 'c -> 'd) ->
'a React.event ->
'b React.event ->
'c React.event ->
'd React.event
val l4 :
('a -> 'b -> 'c -> 'd -> 'e) ->
'a React.event ->
'b React.event ->
'c React.event ->
'd React.event ->
'e React.event
val l5 :
('a -> 'b -> 'c -> 'd -> 'e -> 'f) ->
'a React.event ->
'b React.event ->
'c React.event ->
'd React.event ->
'e React.event ->
'f React.event
val l6 :
('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g) ->
'a React.event ->
'b React.event ->
'c React.event ->
'd React.event ->
'e React.event ->
'f React.event ->
'g React.event
Lwt-specific utilities
val with_finaliser : (unit -> unit) -> 'a event -> 'a event
with_finaliser f e
returns an event e'
which behave as e
, except that f
is called when e'
is garbage collected.
next e
returns the next occurrence of e
limit f e
limits the rate of e
with f
.
For example, to limit the rate of an event to 1 per second you can use: limit (fun () -> Lwt_unix.sleep 1.0) event
.
from f
creates an event which occurs each time f ()
returns a value. If f
raises an exception, the event is just stopped.
Creates a stream holding all values occurring on the given event
of_stream stream
creates an event which occurs each time a value is available on the stream.
delay thread
is an event which does not occurs until thread
returns. Then it behaves as the event returned by thread
.
val keep : 'a event -> unit
keep e
keeps a reference to e
so it will never be garbage collected.
The following functions behave as their React
counterpart, except that they takes functions that may yield.
As usual the _s
suffix is used when calls are serialized, and the _p
suffix is used when they are not.
Note that *_p
functions may not preserve event order.