package bonsai

  1. Overview
  2. Docs
A library for building dynamic webapps, using Js_of_ocaml

Install

Dune Dependency

Authors

Maintainers

Sources

bonsai-v0.16.0.tar.gz
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303

doc/bonsai.driver/Bonsai_driver/index.html

Module Bonsai_driverSource

module Incr = Ui_incr
Sourcetype 'r t
Sourceval create : ?initial_model_sexp:Core.Sexp.t -> ?optimize:bool -> clock:Incr.Clock.t -> 'r Bonsai.Computation.t -> 'r t

Builds a new driver for a bonsai component.

The "main loop" of a bonsai handle is 1. flush - dequeue events and process actions 2. result - compute the final value of the computation 3. trigger_lifecycles - run any lifecycle events for this stabilization

Sourceval flush : _ t -> unit

Apply all pending actions and stabilize the incremental graph, updating result.

Sourceval result : 'r t -> 'r

retreives the computed result of the bonsai application

Sourceval trigger_lifecycles : _ t -> unit

Triggers all lifecycle events that need to be run. Lifecycle events are run in this order: 1. componnet deactivations 2. component activations 3. after display, which includes things like on_change

Sourceval schedule_event : _ t -> unit Ui_effect.t -> unit

Schedules an event

Sourceval has_after_display_events : _ t -> bool

returns true if the lifecycle collection has anything that it wants to do after the display is processed.

Sourcemodule Expert : sig ... end
OCaml

Innovation. Community. Security.