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.web_ui_visibility/Bonsai_web_ui_visibility/index.html

Module Bonsai_web_ui_visibilitySource

only_when_visible runs the provided computation for at least one frame initially, and then if the node is visible, will keep that computation active, but if it ever becomes hidden, the computation is deactivated and the most recent computed vdom node is returned instead. Upon becoming visible again, the computation is reactivated.

visible_attr and hidden_attr are optional attributes that will be attached to the dom nodes based on their visibility status.

Like only_when_visible, but if the component returns more than just a vdom node, you can propagate the value to the outside. This value is Some when the computation is active, and otherwise None.

Sourcemodule Tracker : sig ... end

A lower-level API, Tracker.component returns an attribute that can be attached to a vdom node along with the status for the visibility of the node that the attribute was attached to.

OCaml

Innovation. Community. Security.