package bonsai
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A library for building dynamic webapps, using Js_of_ocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=c78c4476ee6b856846e2d0941e5965009d5e1b853e564b2b1bee61202f0b1ebb
doc/bonsai/Bonsai/Cont/index.html
Module Bonsai.ContSource
include module type of Cont
with module For_proc2 := Cont.For_proc2
and module Conv := Cont.Conv
Source
type ('k, 'cmp) comparator =
(module Bonsai__.Module_types.Comparator
with type comparator_witness = 'cmp
and type t = 'k)include Core.Applicative.S with type 'a t := 'a t
Useful for optional args that take Bonsai.ts. Note: the inverse operation is not possible.
Source
val state :
?reset:('model -> 'model) ->
?sexp_of_model:('model -> Core.Sexp.t) ->
?equal:('model -> 'model -> bool) ->
'model ->
graph ->
'model t * ('model -> unit Ui_effect.t) tSource
val state_opt :
?reset:('model option -> 'model option) ->
?sexp_of_model:('model -> Core.Sexp.t) ->
?equal:('model -> 'model -> bool) ->
?default_model:'model ->
graph ->
'model option t * ('model option -> unit Ui_effect.t) tSource
val state_machine0 :
?reset:('action Apply_action_context.t -> 'model -> 'model) ->
?sexp_of_model:('model -> Core.Sexp.t) ->
?sexp_of_action:('action -> Core.Sexp.t) ->
?equal:('model -> 'model -> bool) ->
default_model:'model ->
apply_action:('action Apply_action_context.t -> 'model -> 'action -> 'model) ->
graph ->
'model t * ('action -> unit Ui_effect.t) tSource
val state_machine1 :
?reset:('action Apply_action_context.t -> 'model -> 'model) ->
?sexp_of_model:('model -> Core.Sexp.t) ->
?sexp_of_action:('action -> Core.Sexp.t) ->
?equal:('model -> 'model -> bool) ->
default_model:'model ->
apply_action:
('action Apply_action_context.t ->
'input Computation_status.t ->
'model ->
'action ->
'model) ->
'input t ->
graph ->
'model t * ('action -> unit Ui_effect.t) tSource
val actor0 :
?reset:
(inject:('action -> 'return Ui_effect.t) ->
schedule_event:(unit Ui_effect.t -> unit) ->
'model ->
'model) ->
?sexp_of_model:('model -> Core.Sexp.t) ->
?sexp_of_action:('action -> Core.Sexp.t) ->
?equal:('model -> 'model -> bool) ->
default_model:'model ->
recv:
(inject:('action -> 'return Ui_effect.t) ->
schedule_event:(unit Ui_effect.t -> unit) ->
'model ->
'action ->
'model * 'return) ->
graph ->
'model t * ('action -> 'return Ui_effect.t) tSource
val actor1 :
?sexp_of_action:('action -> Core.Sexp.t) ->
?reset:
(inject:('action -> 'return Ui_effect.t) ->
schedule_event:(unit Ui_effect.t -> unit) ->
'model ->
'model) ->
?sexp_of_model:('model -> Core.Sexp.t) ->
?equal:('model -> 'model -> bool) ->
default_model:'model ->
recv:
(inject:('action -> 'return Ui_effect.t) ->
schedule_event:(unit Ui_effect.t -> unit) ->
'input Computation_status.t ->
'model ->
'action ->
'model * 'return) ->
'input t ->
graph ->
'model t * ('action -> 'return Ui_effect.t) tSource
val freeze :
?sexp_of_model:('a -> Core.Sexp.t) ->
?equal:('a -> 'a -> bool) ->
'a t ->
graph ->
'a tSource
val most_recent_some :
?sexp_of_model:('b -> Core.Sexp.t) ->
equal:('b -> 'b -> bool) ->
'a t ->
f:('a -> 'b option) ->
graph ->
'b option tSource
val most_recent_value_satisfying :
?sexp_of_model:('a -> Core.Sexp.t) ->
equal:('a -> 'a -> bool) ->
'a t ->
condition:('a -> bool) ->
graph ->
'a option tSource
val previous_value :
?sexp_of_model:('a -> Core.Sexp.t) ->
equal:('a -> 'a -> bool) ->
'a t ->
graph ->
'a option tSource
val wrap :
?reset:('action Apply_action_context.t -> 'model -> 'model) ->
?sexp_of_model:('model -> Core.Sexp.t) ->
?equal:('model -> 'model -> bool) ->
default_model:'model ->
apply_action:
('action Apply_action_context.t -> 'result -> 'model -> 'action -> 'model) ->
f:('model t -> ('action -> unit Ui_effect.t) t -> graph -> 'result t) ->
graph ->
'result tpeek maps a Bonsai.t to an Effect.t with the same underlying value. This allows you to inspect the 'a value from inside of a let%bind.Effect chain which might have been changed by previous effects. It is analogous to peek on other abstract data types, including Deferred.ts and Mvar.ts, but more constrained in that you still can only read from within an effect bind.
The 'a Computation_state.t returned by the effect means that if the value was inactive at the time it is peeked, then the effect will be unable to retrieve it.
Source
val assoc :
('k, 'cmp) comparator ->
('k, 'v, 'cmp) Core.Map.t t ->
f:('k t -> 'v t -> graph -> 'a t) ->
graph ->
('k, 'a, 'cmp) Core.Map.t tSource
val assoc_set :
('key, 'cmp) comparator ->
('key, 'cmp) Core.Set.t t ->
f:('key t -> graph -> 'result t) ->
graph ->
('key, 'result, 'cmp) Core.Map.t t sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>