Module Snapshot.Make
Bonsai can be used with any Incremental-style UI framework. The parameters for the Bonsai component functor are an instance of Incremental (used to re-evaluate the UI only when the UI model has changed) and an opaque Event.t type (which is used to schedule actions).
Parameters
Signature
module Event : Core_kernel.T
A Snapshot represents the state of a component at an instant in time.
val apply_action : ('model, 'action, _) t -> schedule_event:(Event.t -> unit) -> 'action -> 'model
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_action
function to request that further actions be enqueued to be applied to the model.
val result : (_, _, 'result) t -> 'result
The result of a component is the primary value computed by the component in question. At the toplevel 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.