bonsai

A library for building dynamic webapps, using Js_of_ocaml
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library bonsai
Module Bonsai . Private . Snapshot
type ('model, 'action, 'result) t
val apply_action : ( 'model, 'action, _ ) t -> ( 'model, 'action ) Bonsai__Apply_action.t

Applies the provided action to the model in force at the time that the snapshot was created.

The application of the action is allowed to engage in side-effecting computations, including calling the schedule_event function to request that further actions be enqueued to be applied to the model.

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.Map.Key.t, Bonsai__Lifecycle.t, Bonsai__Path.Map.Key.comparator_witness ) Core.Map_intf.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.Map.Key.t, Bonsai__Lifecycle.t, Bonsai__Path.Map.Key.comparator_witness ) Core.Map_intf.Map.t Ui_incr.t
val create : apply_action:( 'model, 'action ) Bonsai__Apply_action.t -> lifecycle: ( Bonsai__Path.Map.Key.t, Bonsai__Lifecycle.t, Bonsai__Path.Map.Key.comparator_witness ) Core.Map_intf.Map.t Ui_incr.t option -> result:'result Ui_incr.t -> ( 'model, 'action, '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