package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A snapshot represents the state of a component at an instant in time.

type ('model, 'action, 'input, 'result) t
val input : (_, _, 'input, _) t -> 'input Bonsai__.Input.t

The input in a snapshot contains any incrementally computed data required by the computation's apply-action function.

val result : (_, _, _, 'result) t -> 'result Ui_incr.t

The result of a component is the primary value computed by the component in question. At the top level of a UI, this is generally a representation of the view, but it's often useful to compute other kinds of results in inner components.

val lifecycle : (_, _, _, _) t -> (Bonsai__.Path.t, Bonsai__.Lifecycle.t, Bonsai__.Path.comparator_witness) Base.Map.t Ui_incr.t option

The lifecycle component of a snapshot contains an optional map of all the activation, deactivation, and after_display callbacks.

val lifecycle_or_empty : (_, _, _, _) t -> (Bonsai__.Path.t, Bonsai__.Lifecycle.t, Bonsai__.Path.comparator_witness) Base.Map.t Ui_incr.t
val create : input:'input Bonsai__.Input.t -> lifecycle: (Bonsai__.Path.t, Bonsai__.Lifecycle.t, Bonsai__.Path.comparator_witness) Base.Map.t Ui_incr.t option -> result:'result Ui_incr.t -> ('model, 'action, 'input, 'result) t

Creates a new snapshot. Note that the apply_action provided here should apply the action in question to the model in force at the time create is called.

val attribute_positions : Core.Source_code_position.t option -> (_, _, _, _) t -> unit
OCaml

Innovation. Community. Security.