This project has been deprecated. In modern versions of Arez it is trivial to reimplement if required.
This library provides a utility class that will dispose a target object after a time delay.
The simplest way to use component;
- add the following dependencies into the build system. i.e.
<dependency>
<groupId>org.realityforge.arez.timeddisposer</groupId>
<artifactId>arez-timeddisposer</artifactId>
<version>0.57</version>
</dependency>
-
add the snippet
<inherits name="arez.timeddisposer.TimedDisposer"/>
into the .gwt.xml file. -
Use the
TimedDisposer
component. eg.
import arez.Arez;
import arez.Disposable;
import arez.Observer;
import arez.ticker.IntervalTicker;
import arez.timeddisposer.TimedDisposer;
import com.google.gwt.core.client.EntryPoint;
import elemental2.dom.DomGlobal;
public class TimedDisposerExample
implements EntryPoint
{
@Override
public void onModuleLoad()
{
final IntervalTicker ticker = IntervalTicker.create( 1000 );
final Observer observer = Arez.context().autorun( () -> {
if ( !Disposable.isDisposed( ticker ) )
{
DomGlobal.console.log( "Tick: " + ticker.getTickTime() );
}
else
{
DomGlobal.console.log( "Ticker disposed!" );
}
} );
TimedDisposer.create( Disposable.asDisposable( ticker ), 5500 );
TimedDisposer.create( Disposable.asDisposable( observer ), 7000 );
}
}
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.