Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geolocation.Options takes unitless values instead of Times #10

Open
BrianHicks opened this issue Aug 1, 2017 · 0 comments
Open

Geolocation.Options takes unitless values instead of Times #10

BrianHicks opened this issue Aug 1, 2017 · 0 comments

Comments

@BrianHicks
Copy link
Member

BrianHicks commented Aug 1, 2017

The record for Geolocation.Options has the following structure:

type alias Options = 
    { enableHighAccuracy : Bool
    , timeout : Maybe Int
    , maximumAge : Maybe Int
    }

The documentation specifies these values are in milliseconds. I'm curious why this isn't implemented using a Time instead. Wouldn't it reduce mistakes to use an interface that encodes the unit as well as the value?

-- unitless integers
{ defaultOptions | maximumAge = Just 30000 }

-- Times
{ defaultOptions | maximumAge = Just (30 * Time.second) }

(moved from #9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant