Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.
/ arez-dom Public archive

Arez browser components that make DOM properties observable

License

Notifications You must be signed in to change notification settings

arez/arez-dom

Repository files navigation

Arez-DOM

Build Status

This library provides a collection of Arez browser components that expose various aspects of the browser object model as observable properties. Each Arez component will listen to changes from the browser if and only if the observable provided by the component is observed. However if there is no observer for the state, the component will not listen to to the browser events so as not to have any significant performance impact.

Quick Start

The simplest way to use component;

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

  • Use one of the many components provided by the library. A list of some examples provided by the library includes but is not limited to:

    • DocumentVisibility: Exposes document.visibilityState as an observable property for specified documents.
    • EventDrivenValue: Generic component that exposes a property as observable where changes to the variable are signalled using an event.
    • GeoPosition: A component that exposes the current geo position as an observable property.
    • IdleStatus: 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.
    • MediaQuery: An Arez browser component that exposes a flag indicating whether the browser matches a particular CSS media query.
    • NetworkStatus: An Arez browser component that tracks when the user is "online".
    • WindowSize: Factory for creating observables for dimensions of a window. (i.e. window.(inner|outer)(Width|Height))

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.