Skip to content
This repository has been archived by the owner on Dec 30, 2018. It is now read-only.

Latest commit

 

History

History
66 lines (47 loc) · 2.14 KB

README.md

File metadata and controls

66 lines (47 loc) · 2.14 KB

Deprecated

Project has been merged into arez-dom


Arez-IdleStatus

Build Status

This library provides an Arez browser component that tracks when the user is idle. A user is considered idle if they have not interacted with the browser for a specified amount of time.

Quick Start

The simplest way to use component;

  • add the following dependencies into the build system. i.e.
<dependency>
   <groupId>org.realityforge.arez.idlestatus</groupId>
   <artifactId>arez-idlestatus</artifactId>
   <version>0.48</version>
</dependency>
  • add the snippet <inherits name="arez.idlestatus.IdleStatus"/> into the .gwt.xml file.

  • Use the IdleStatus component. eg.

import com.google.gwt.core.client.EntryPoint;
import elemental2.dom.DomGlobal;
import arez.Arez;
import arez.idlestatus.IdleStatus;

public class IdleStatusExample
  implements EntryPoint
{
  public void onModuleLoad()
  {
    final IdleStatus idleStatus = IdleStatus.create();
    Arez.context().autorun( () -> {
      final String message = "Interaction Status: " + ( idleStatus.isIdle() ? "Idle" : "Active" );
      DomGlobal.console.log( message );
    } );
  }
}

More Information

For more information about component, please see the Website. For the source code and project support please visit the GitHub project.

Contributing

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.

License

The component is licensed under Apache License, Version 2.0.