 
 (deftemplate result-cards "templates/results.html" []
   {[:.card] (kioo/content (map result-card
-                                   (get-in @state [:results :_source])}))})
+                            (get-in @state [:results :_source])))})
 
 (deftemplate page "index.html" []
-  {[:.results] (kioo/content (result-cards))})
+  {[:.search-field] (kioo/listen :on-key-press
+                      (fn []
+                        (go
+                          (.log js/console "Press")
+                          (>! query-chan (.-value (dom/getElement "search-field"))))))
+
+   [:.results] (kioo/content (result-cards))})
 
 (defn init []
-  (reagent/render-component [page] (.-body js/document))
-  (query-input-loop))
+  (reagent/render-component [page] (.-body js/document)))

            [kioo.reagent :as kioo]
            [cljs-http.client :as http])
  (:require-macros [kioo.reagent :refer [defsnippet deftemplate]]
                   [cljs.core.async.macros :refer [go-loop]]))

; ElasticSearch API URL
(def query-url "http://168.235.155.245/beers/2015/_search")

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

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