lue-bird/elm-state-interface/1.0.0

NOTE: the latest version is 2.0.4

Web.Time

Helpers for elm/time primitives as part of an Interface

posixRequest : Interface Posix

Get the POSIX time at the moment when this interface is added.

Replacement for elm/time's Time.now.

zoneRequest : Interface Zone

Produce a Zone based on the current UTC offset.

Replacement for elm/time's Time.here.

zoneNameRequest : Interface ZoneName

Intended for package authors. Use Intl.DateTimeFormat().resolvedOptions().timeZone to try to get names like Europe/Moscow or America/Havana. From there you can look it up in any IANA data you loaded yourself.

Replacement for elm/time's Time.getZoneName.

periodicallyListen : Duration -> Interface Posix

An Interface that sends you the current time every time a given Duration has passed.

Note: Do not use it for animations. Web.Window.animationFrameListen syncs up with repaints and will end up being much smoother for any moving visuals.