Fork me on GitHub
#re-frame
<
2016-10-16
>
mikethompson06:10:09

(defn get-position 
  [] 
  (let  [geo (.-geolocation js/navigator)]
    (.getCurrentPosition geo  #(dispatch [:set-location %]))))

(def-event-db 
  :set-location
  (fn  [db [_ pos]]
    (assoc db :location pos))
I'd assume you'd (get-position) sometime early in your application's boot? Warning: I know nothing of this API ... I just glanced at the gists.