package org.realityforge.arez.gwt.examples;

import elemental2.dom.DomGlobal;
import org.realityforge.arez.Arez;
import org.realityforge.arez.browser.extras.spy.ConsoleSpyEventProcessor;
import org.realityforge.arez.extras.WhyRun;

final class ExampleUtil
{
  private ExampleUtil()
  {
  }

  static void spyEvents()
  {
    Arez.context().getSpy().addSpyEventHandler( new ConsoleSpyEventProcessor() );
  }

  static void jsonLogSpyEvents()
  {
    Arez.context().getSpy().addSpyEventHandler( new JsonLogSpyEventProcessor() );
  }

  static void whyRun()
  {
    DomGlobal.console.log( new WhyRun( Arez.context() ).whyRun() );
  }

  static void logAllErrors()
  {
    Arez.context().addObserverErrorHandler( ( observer, error, throwable ) -> {
      DomGlobal.console.log( "Observer error: " + error + "\nobserver: " + observer );
      if ( null != throwable )
      {
        DomGlobal.console.log( throwable );
      }
    } );
  }
}

@@ -139,268 +139,77 @@
 rez.
-browser.extras.spy.ConsoleSpyEventProcessor;%0Aimport org.realityforge.arez.extras.WhyRun;%0A%0Afinal class ExampleUtil%0A%7B%0A  private ExampleUtil()%0A  %7B%0A  %7D%0A%0A  static void spyEvents()%0A  %7B%0A    Arez.context().getSpy().addSpyEventHandler( new ConsoleSpyEventProcessor() );
+extras.WhyRun;%0A%0Afinal class ExampleUtil%0A%7B%0A  private ExampleUtil()%0A  %7B
 %0A  %7D

Remove code no longer required