module Core: Sharp_coretypetime =float
type 'a t
val const : 'a -> 'a tval time : time tval map : ('a -> 'b) -> 'a t -> 'b tval (<$>) : ('a -> 'b) -> 'a t -> 'b tmap.val pure : 'a -> 'a tconst.val apply : ('a -> 'b) t -> 'a t -> 'b tval (<*>) : ('a -> 'b) t -> 'a t -> 'b tapply.val lift0 : 'a -> 'a tval lift : ('a -> 'b) -> 'a t -> 'b t
val lift2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
val lift3 : ('a -> 'b -> 'c -> 'd) ->
'a t -> 'b t -> 'c t -> 'd t
val lift4 : ('a -> 'b -> 'c -> 'd -> 'e) ->
'a t ->
'b t -> 'c t -> 'd t -> 'e t
val lift5 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f) ->
'a t ->
'b t ->
'c t -> 'd t -> 'e t -> 'f t
val map_opt : ('a -> 'b) -> 'a option t -> 'b option tmap on optional signals.val (<$?>) : ('a -> 'b) -> 'a option t -> 'b option tmap_opt.val apply_opt : ('a -> 'b) option t ->
'a option t -> 'b option tapply on optional signals.val (<*?>) : ('a -> 'b) option t ->
'a option t -> 'b option tapply_opt.val sequence : 'a t list -> 'a list tval return : 'a -> 'a tconst.val join : 'a t t -> 'a tval bind : 'a t -> ('a -> 'b t) -> 'b tval (>>=) : 'a t -> ('a -> 'b t) -> 'b tbind.val (>>) : 'a t -> 'b t -> 'b t>>= but it discards the value of the first signal.val perform : ?force:bool -> 'a t -> ('a -> unit) -> unit
To be precise, the signal could have the same value as before but something
happened upstream. If some signals have been triggered and the signal passed
to perform somehow depends on it, through calls to map or apply for
instance, the function given to perform will be called.
val perform_state : ?force:bool -> 'a t -> init:'b -> f:('b -> 'a -> 'b) -> unitval react : 'a option t -> ('a -> unit) -> unitval react_with : 'a option t -> 'b t -> ('a -> 'b -> unit) -> unitreact with an additional signal.
This is useful for things like
react_with button_cliked data_signal (fun () data -> (* do something *)).
val event : unit -> 'a option t * ('a -> unit)val connected_event : (('a -> unit) -> unit -> unit) ->
'a option t * ('a -> unit) * (unit -> unit)
The first callback takes the trigger function and should return the second
callback to disconnect the event. To make its use clearer, imagine you want
to create a signal which should be triggered automatically when some JS
event occurs. The first callback would be a function starting to listen to
a JS event, calling the trigger function when the event occurs and returning
a callback to destroy the listener when it's called.
val on : 'a option t -> init:'b -> f:('b -> 'a -> 'b) -> 'b tinit and changing this value based
on the previous one and a value of an optional signal when it takes one.val last : 'a option t -> init:'a -> 'a tinit if none.val toggle : 'b option t -> init:bool -> bool ttrue and false each time the given optional signal takes
a value.val count : ?init:int -> 'b option t -> int tval upon : ?init:'a -> 'c option t -> 'a t -> 'a tval fold : 'a t -> init:'b -> f:('b -> 'a -> 'b) -> 'b t
It is important to understand that signals are only called when something
happened. It is therefore not continuous.