             [kioo.reagent :as kioo]
             [cljs-http.client :as http])
   (:require-macros [kioo.reagent :refer [defsnippet deftemplate]]
-                   [cljs.core.async.macros :refer [go-loop]]))
+                   [cljs.core.async.macros :refer [go go-loop]]))
 
 ; ElasticSearch API URL
 (def query-url "http://168.235.155.245/beers/2015/_search")


(deftemplate result-cards "templates/results.html" []
  {[:.card] (kioo/content (map result-card
                                   (get-in @state [:results :_source])}))})

(deftemplate page "index.html" []
  {[:.results] (kioo/content (result-cards))})

(defn init []
  (reagent/render-component [page] (.-body js/document))
  (query-input-loop))

(def extract-hits-out (extract-hits get-results-out))
(update-results-state extract-hits-out)

; Templating
(def labels
  {:category-drugs "Therapeutic Category: Drug(s)"
