package bonsai
A library for building dynamic webapps, using Js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
bonsai-v0.14.0.tar.gz
sha256=43f35d648644492d776bf2c7b86c8227e7793615b6a658432e95f8dccd3631f8
md5=b5e743dbfa64d0da5fd660f14cd0b549
doc/bonsai.types/Bonsai_types/index.html
Module Bonsai_types
module Snapshot : sig ... end
A Snapshot represents the state of a component at an instant in time.
module Environment : sig ... end
module type Model = sig ... end
module type Action = sig ... end
module type Comparator = sig ... end
We need keys to have t_of_sexp
and sexp_of_t
type ('k, 'cmp) comparator =
(module Comparator
with type comparator_witness = 'cmp
and type t = 'k)
val nothing_type_id : Core_kernel.Nothing.t Core_kernel.Type_equal.Id.t
val unit_type_id : unit Core_kernel.Type_equal.Id.t
type ('input, 'model, 'action, 'result, 'incr, 'event) eval_type =
input:('input, 'incr) Incremental.t ->
old_model:('model option, 'incr) Incremental.t ->
model:('model, 'incr) Incremental.t ->
inject:('action -> 'event) ->
action_type_id:'action Core_kernel.Type_equal.Id.t ->
environment:'incr Environment.t ->
incr_state:'incr Incremental.State.t ->
('input, 'model, 'action, 'result, 'incr, 'event) unpacked ->
(('model, 'action, 'result, 'event) Snapshot.t, 'incr) Incremental.t
module Packed : sig ... end
module Visitor : sig ... end
module type Definition = sig ... end
val define : (module Definition) -> unit
Dynamic dispatch
The functions below dispatch on the extension constructor of the input component, which must have been registered with define
.
val eval_ext :
input:('input, 'incr) Incremental.t ->
old_model:('model option, 'incr) Incremental.t ->
model:('model, 'incr) Incremental.t ->
inject:('action -> 'event) ->
action_type_id:'action Core_kernel.Type_equal.Id.t ->
environment:'incr Environment.t ->
incr_state:'incr Incremental.State.t ->
('input, 'model, 'action, 'result, 'incr, 'event) unpacked ->
(('model, 'action, 'result, 'event) Snapshot.t, 'incr) Incremental.t
val visit_ext :
('input, 'result, 'incr, 'event) Packed.t ->
Visitor.t ->
('input, 'result, 'incr, 'event) Packed.t
Depth-first mapping transformation over a component tree.
The reason that visit_ext takes (and returns) Packed.t values instead of unpacked values is so that an optimization stage can change the type of an action parameter during optimization
val sexp_of_unpacked : (_, _, _, _, _, _) unpacked -> Core_kernel.Sexp.t
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page