Derived_model
is the data container that allows you to share computations between
the actions and the view. Any things that the actions need to use should be stored
in Derived_model.t. Then, in Action.apply
, you can call
stabilize_and_get_derived
to retrieve that data and make use of it.
val create : Model.t Incr_dom.Incr.t ‑> t Incr_dom.Incr.t
create
sets up the incremental that performs the shared computations. Sharing
computations will typically look something like this:
let%map shared1 = computation1
and shared2 = computation2
and shared3 = computation3
in
{ shared1; shared2; shared3 }