package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Starting : sig ... end
val effect_on_change : Core.Source_code_position.t -> (module Model with type t = 'a) -> (module Model with type t = 'o) -> ('o, 'r) Starting.t -> 'a Value.t -> effect:('a -> 'o Effect.t) Value.t -> 'r Computation.t

This function runs an effect every time that the input value changes, returning the most recent result as its computation.

The Starting.t argument controls the type of the result, and depending on the value, will either return an optional value Option.None or a default value 'o in the time in between the computation starting and the first result coming back from the effect.

OCaml

Innovation. Community. Security.