1234567891011121314151617181920212223242526272829303132333435open!Core_kernelopen!ImportmoduleDependency=structtype'at='aExpert.edge[@@derivingsexp_of]letcreate?(on_change=ignore)child:_t={child;on_change;index=Uopt.none}letvalue(t:_t)=letstate=t.child.stateinifdebugthenState.Expert.assert_currently_running_node_is_parentstatet.child"Dependency.value";(* Not exposing the _exn, because this function is advertised as being usable only
inside the callbacks of parents, where it will not raise. *)Node.value_exnt.child;;endmoduleNode=structtypenonrec'at='aNode.t[@@derivingsexp_of]letcreatestate?(on_observability_change=fun~is_now_observable:_->())f=State.Expert.createstate~on_observability_changef;;letmake_stale=State.Expert.make_staleletwatch=Fn.idletinvalidate=State.Expert.invalidateletadd_dependency=State.Expert.add_dependencyletremove_dependency=State.Expert.remove_dependencyend