title: Automatically add the current user's geolocation
body: <p>I'm still new to Redux.</p>
  
  <p>I want my app to manage a list of places. I have followed the <a href="http://redux.js.org/docs/basics/ExampleTodoList.html" rel="nofollow">Official TODOList tutorial</a> and replaced <code>TODO</code>s with <code>Place</code>s. Good start :)</p>
  
  <p>Now, I'd like to use the <a href="http://www.w3schools.com/html/html5_geolocation.asp" rel="nofollow">Geolocation API</a> to automatically add the current user's place if available.</p>
  
  <p>I have a <code>&lt;PlaceInput&gt;</code> container, which when triggered <code>dispatch</code>es the event <code>addPlace</code>. </p>
  
  <p>But I'm wondering where I should add the logic to add the current users' place.</p>
  
  <h3>1. At the root document?</h3>
  
  <pre><code>let store = createStore(placesApp);
  
  // update the store immediately if available
  
  render(
    &lt;Provider store={store}&gt;
      &lt;App /&gt;
    &lt;/Provider&gt;,
    document.getElementById('root')
  )
  </code></pre>
  
  <p>I'm not a big fan of this strategy since the authorization for geolocation requires user action the first time, which makes it asynchronous by nature.</p>
  
  <h3>2. In a "fake" container that does just this?</h3>
  
  <pre><code>class AddUserGeolocation extends React.Component {
  
    static propTypes = {
      alreadyAsked: React.PropTypes.bool.isRequired
    }
  
    componentDidMount {
      if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition((position) =&gt; {
          dispatcher(addPlace('You', position.coords.latitude, position.coords.longitude))
        });
        dispatcher(askedForUserLocation())
      }
    };
  
    render() {
      let result = this.props.alreadyAsked ? 'Asked' : 'Not yet'
      return (
        &lt;div&gt;
          {result}
        &lt;/div&gt;
      )
    }
  }
  </code></pre>