bonsai
A library for building dynamic webapps, using Js_of_ocaml
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
package bonsai
-
bonsai
-
-
bonsai.bench
-
bonsai.example_chat_open_source_native
-
bonsai.example_chat_open_source_native_common
-
-
bonsai.extra
-
-
bonsai.focus_ring
-
bonsai.protocol
-
bonsai.tailwind_colors
-
bonsai.test
-
bonsai.test.dot
-
bonsai.web_test
-
bonsai.web_ui_common_components
-
bonsai.web_ui_drag_and_drop
-
bonsai.web_ui_element_size_hooks
-
bonsai.web_ui_file
-
bonsai.web_ui_file_from_web_file
-
bonsai.web_ui_form
-
-
bonsai.web_ui_freeform_multiselect
-
bonsai.web_ui_multi_select
-
-
bonsai.web_ui_query_box
-
bonsai.web_ui_reorderable_list
-
bonsai.web_ui_typeahead
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val value_cutoff : 'a Value.t -> equal:( 'a -> 'a -> bool ) -> 'a Computation.t
A Value.t
passed through value_cutoff
will only trigger changes on its dependents when the value changes according to the provided equality function
val model_cutoff : 'a Computation.t -> 'a Computation.t
You can use model_cutoff
to override the value cutoff for the model for a computation to the equality function that your computation specified via the Model.equal
function passed to of_module
, state
, etc...
val compute :
'a Value.t ->
f:( 'a Ui_incr.t -> 'b Ui_incr.t ) ->
'b Computation.t
Use compute
to move a function from the incremental world into the bonsai world.
If you've got an incremental, you can convert it to a value with this function.
val with_clock : ( Ui_incr.Clock.t -> 'a Ui_incr.t ) -> 'a Computation.t
Compute some incremental value based on the global clock. Using this clock instead of Incr.clock
is the more testable approach, since it allows tests to control how time moves forward.
ON THIS PAGE
No table of contents