package arez.doc.examples.tracker;

import arez.Arez;
import arez.Observer;
import arez.Procedure;

public class TrackerExample
{
  public static void main( String[] args )
    throws Throwable
  {
    final Procedure trackedFunction = () -> {
      // Interact with arez observable state (or computed values) here
      // and any time these changed the rescheduleRender function will
      // be run which will somehow reschedule this function.
      //DOC ELIDE START
      //DOC ELIDE END
    };
    final Observer tracker = Arez.context().tracker( () -> rescheduleRender() );
    //DOC ELIDE START
    //DOC ELIDE END
    // The rescheduleRender should ultimately result in the following
    // invocation. This call will need to be run at least once so that
    // the Arez runtime can determine the dependencies and reschedule
    // when the dependencies are changed.
    Arez.context().track( tracker, trackedFunction );
  }

  static void rescheduleRender()
  {

  }
}

@@ -211,21 +211,22 @@
 ocedure 
-track
+observ
 edFuncti
@@ -905,21 +905,22 @@
 racker, 
-track
+observ
 edFuncti
@@ -967,15 +967,14 @@
 r()%0A  %7B%0A
-%0A
   %7D%0A%7D%0A

Rename variable to reflect current terminology