-
Notifications
You must be signed in to change notification settings - Fork 2k
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
State: Add geolocation #7457
State: Add geolocation #7457
Conversation
Pinging also @aduth, since this functionality could also be used to enhance geolocation in post editor. |
} ); | ||
|
||
return new Promise( ( resolve, reject ) => { | ||
superagent.get( 'https://public-api.wordpress.com/geo.php', null, ( error, res ) => { |
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.
We recently (#6947, cc @retrofox ) upgraded superagent
to 2.x, which adds proper Promise support, so instead of creating a Promise instance you could simply return this get
call.
02a6170
to
671f268
Compare
671f268
to
34c6b47
Compare
Rebased and fixed everything commented. Ready for a review |
*/ | ||
import { combineReducers } from 'redux'; | ||
import camelCase from 'lodash/camelCase'; | ||
import mapKeys from 'lodash/mapKeys'; |
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.
Optional, but we can now do the following without worrying about bundle size: see #6539
import { camelCase, mapKeys } from 'lodash';
Yikes, I knew it sounded familiar, but I totally forgot about this pull request. At least it appears we took a very similar approach! #8423 doesn't include tests or good JSDoc with the expectation that it'd be short-lived, so if there's a desire to use it elsewhere, we should plan to add those. |
Yeah, I noticed when I had merge conflicts in Once I finish #7453 , it is going to stay for a long time. So yeah, it's a good idea to add tests & docs. |
This PR is part of #7453 and fixes #7455.
Adds
geolocation
to the state tree./cc: @klimeryk @aidvu
Test live: https://calypso.live/?branch=add/geolocation