Skip to content

Instantly share code, notes, and snippets.

@jamak
Created May 15, 2014 19:14
Show Gist options
  • Save jamak/9aecd43e209e42999055 to your computer and use it in GitHub Desktop.
Save jamak/9aecd43e209e42999055 to your computer and use it in GitHub Desktop.
om/IRenderState
(render-state
[this {:keys [move toggle
google-map directions-renderer
center directions poi-visible]}]
;; any diffs to the DOM are handled automatically by React,
;; but we have to manually diff the parts of the Google Maps state that we are managing:
(when (:dirty center)
(.panTo google-map (:data center)))
(when (:dirty directions)
(.setDirections directions-renderer (:data directions)))
(when (:dirty poi-visible)
(toggle-poi-layer owner))
(update-markers (:points app) owner)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment