package bonsai
A library for building dynamic webapps, using Js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
bonsai-v0.13.0.tar.gz
sha256=5a492e4189037202ea780d228b2fd29da177da5c98dc2685f83968fc9f589d97
md5=36feac848fcb4118929df74939d1d111
doc/bonsai.web/Bonsai_web/Start/index.html
Module Bonsai_web.Start
Start
handles the entire lifecycle of web-based Bonsai application.
Put another way, Start
is like Core.Command
for Bonsai_web apps.
module Handle : sig ... end
Start functions
val start_standalone :
initial_input:'input ->
initial_model:'model ->
bind_to_element_with_id:string ->
('input, 'model, Virtual_dom.Vdom.Node.t)
Bonsai.Make(Incr_dom.Incr)(Virtual_dom.Vdom.Event).t ->
('input, Core_kernel.Nothing.t, Core_kernel.Nothing.t) Handle.t
Start an application, receiving a handle that can't schedule any actions.
The outermost Bonsai.t
s result type parameter should be a Vdom.Node.t
, which will be bound to the DOM element with id bind_to_element_with_id
.
val start :
initial_input:'input ->
initial_model:'model ->
bind_to_element_with_id:string ->
('input * ('outgoing -> Virtual_dom.Vdom.Event.t),
'model,
Virtual_dom.Vdom.Node.t * ('incoming -> Virtual_dom.Vdom.Event.t))
Bonsai.Make(Incr_dom.Incr)(Virtual_dom.Vdom.Event).t ->
('input, 'incoming, 'outgoing) Handle.t
Start an application, receiving a handle that can schedule actions of a user-defined type.
The outermost Bonsai.t
s result type parameter should be pair of:
- a
Vdom.Node.t
, which will be bound to the DOM element with idbind_to_element_with_id
; and - an
inject
function that accepts external actions and returnsVdom.Event.t
s.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page