                  :where [?e :sort/name]]
                (d/db state) query)})
 
+(defmethod read :observations
+  [{:keys [state query]} key params]
+  {:value (d/q '[:find [(pull ?e [*]) ...]
+                 :where [?e :observation/sort]]
+               (d/db state) query)})
+
 ; Mutator for state
 (defmulti mutate om/dispatch)
+
+(defn rand-range [min max]
+  (+ min (* (rand) (- max min))))
 
 (defmethod mutate 'observations/add [{:keys [state]} _ entity]
   {:value {:keys [:observations]}

          :on-complete (fn [data]
                         (d/transact! conn data))})

; Start render loop!
(om/add-root! reconciler
  App (gdom/getElement "app"))

(defui App
  static om/IQuery
  (query [this]
    [:sorts :observations])
  Object
  (render [this]
    (let [{:keys [sorts observations]} (om/props this)]
      (dom/div nil
        (dom/h1 nil "Scavenger sorts")
        (add-observation sorts)
        (maps/google-map
         {:center {:lat 59.974021 :lng 10.728273}, :zoom 12}
         (map
          (fn [o] (maps/marker {:lat (:observation/lat o)
                                :lng (:observation/lng o)}))
              observations))))))

(def app (om/factory App))

