Package arez.dom

Class GeoPosition

java.lang.Object
arez.dom.GeoPosition

A component that exposes the current geo position as an observable property. This component relies on the underlying Geolocation API and it's usage is restricted in the same way as the underlying API (i.e. it is only available in secure contexts and it asks user permission before providing data.).

 EventDrivenValue<Window, Integer> innerWidth = EventDrivenValue.create( window, "resize", () -> window.innerWidth )
 

It is important that the code not add a listener to the underlying event source until there is an observer accessing the "value" observable defined by the EventDrivenValue class. The first observer that observes the observable will result in an event listener being added to the event source and this listener will not be removed until there is no observers left observing the value. This means that a component that is not being used has very little overhead.