                  :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]}

     (edn-xhr
      {:method "POST"
       :path "/observations"
       :data (merge entity {:observation/lat 60.029427 :observation/lng 9.955025})
       :on-complete (fn [data] (d/transact! state [data]))}))})

; Scavenger sorts list

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

; Load all observations from API
(edn-xhr {:method "GET"
          :path "/observations"
          :on-complete (fn [data]
                         (d/transact! conn data))})

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