package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val value_cutoff : 'a Value.t -> equal:('a -> 'a -> bool) -> 'a Computation.t

A Value.t passed through value_cutoff will only trigger changes on its dependents when the value changes according to the provided equality function

val model_cutoff : 'a Computation.t -> 'a Computation.t

You can use model_cutoff to override the value cutoff for the model for a computation to the equality function that your computation specified via the Model.equal function passed to of_module, state, etc...

val compute : 'a Value.t -> f:('a Ui_incr.t -> 'b Ui_incr.t) -> 'b Computation.t

Use compute to move a function from the incremental world into the bonsai world.

val to_value : 'a Ui_incr.t -> 'a Value.t

If you've got an incremental, you can convert it to a value with this function.

val with_clock : (Ui_incr.Clock.t -> 'a Ui_incr.t) -> 'a Computation.t

Compute some incremental value based on the global clock. Using this clock instead of Incr.clock is the more testable approach, since it allows tests to control how time moves forward.

OCaml

Innovation. Community. Security.