This project has been deprecated. In modern version of Arezs it is trivial to reimplement and with upcoming projects such as Spritz, it is no longer consider a recommended pattern.
This library provides an Observable model that "ticks" at a specified interval. The tick is actually updating the "tickTime" observable property. The ticks are only generated when there is an observer of the property so there should be no significant performance impact if there is no observers.
The simplest way to use component;
- add the following dependencies into the build system. i.e.
<dependency>
<groupId>org.realityforge.arez.ticker</groupId>
<artifactId>arez-ticker</artifactId>
<version>0.57</version>
</dependency>
-
add the snippet
<inherits name="arez.ticker.IntervalTicker"/>
into the .gwt.xml file. -
Use the
IntervalTicker
component. eg.
import arez.Arez;
import arez.ticker.IntervalTicker;
import com.google.gwt.core.client.EntryPoint;
import elemental2.dom.DomGlobal;
public class IntervalTickerExample
implements EntryPoint
{
@Override
public void onModuleLoad()
{
final IntervalTicker ticker = IntervalTicker.create( 1000 );
Arez.context().autorun( () -> DomGlobal.console.log( "Tick: " + ticker.getTickTime() ) );
}
}
For more information about component, please see the Website. For the source code and project support please visit the GitHub project.
The component was released as open source so others could benefit from the project. We are thankful for any contributions from the community. A Code of Conduct has been put in place and a Contributing document is under development.
The component is licensed under Apache License, Version 2.0.