Module Bonsai.IncrSource

Sourceval 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

Sourceval 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.

Sourceval 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.

Sourceval 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.