       (swap! @query-results (<! in)))))
 
 ; Process pipeline
-(def query-chan (chan))
+
 (def get-results-out (get-results query-chan))
 (def extract-hits-out (extract-hits get-results-out))
 (update-results-state extract-hits-out)

(defsnippet result-card "templates/results.html" [:.card] [result-map]
  {[:.list-column] (kioo/content [:li
                                   [:ul {:class "list-row"}
                                     (map result-data {:_source} result-map)]])})

(deftemplate result-cards "templates/results.html" []
  {[:.card] (map result-card @query-results)})

(deftemplate page "index.html" []
  {[:.search-field] (kioo/listen :on-change #(>!! query-chan .-value))}
  {[:.results] (result-cards)})

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

      (while true
        (>! out {{{hits-vector :hits} :hits} :body} (<! in))))))

;(defn )

(defn update-results-state [in]
  (go
