anchor.diff:      elemental2.dom.DomGlobal.window.addEventListener( "beforeunload", e -> replicant.Replicant.context().deactivate(), true );
   <% if repository.keycloak? -%>
       updateReplicantToken();
  -    elemental2.dom.DomGlobal.setInterval( e -> getKeycloak().updateToken( 30, this::updateReplicantToken ), 5000 );
  +    _updateReplicantTokenTask = zemeckis.Zemeckis.periodicTask( () -> getKeycloak().updateToken( 30, this::updateReplicantToken ), 5000 );
   <% end -%>
     }
   <% end -%>
  
positive.code: <% end -%>
    }
  
    @javax.annotation.Nonnull
    protected final String getApplicationURL()
    {
  
negative.code: 
            // Every minute attempt to update the serviceWorker. If it does update
            // then the "controllerchange" event will fire.
            _serviceWorkerUpdateTask = zemeckis.Zemeckis.periodicTask( registration::update, 60000 );
            return null;
          }, error -> {
            elemental2.dom.DomGlobal.console.log( "ServiceWorker registration failed: ", error );
  