-
Notifications
You must be signed in to change notification settings - Fork 0
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
188071551 locations setup #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks 👍
name: c.values.location, | ||
latitude: c.values.latitude, | ||
longitude: c.values.longitude, | ||
coordinatePair: `(${c.values.latitude},${c.values.longitude})` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea here to have something like a unique ID/key that can be easily compared? It's a pretty cool idea. However, I think I'll need a helper function like locationsEqual = (a, b) => a.lat === b.lat && a.long === b.long
to check if a given lat/long matches any option in the dropdown. Then we could probably skip storing this derived property. This equality helper should probably be universal throughout the whole app. Alternatively, another option could be to generate this ID/key from the lat/long pair and compare the result. But it's pretty minor dilemma. 😉
This adds the maintenance of an array of
locations
.Locations are potentially updated on three events:
Locations are used to