   (:refer-clojure :exclude [replace])
   (:require-macros [cljs.core.async.macros :refer [go go-loop]])
   (:require [db-quiz.config :refer [config]]
+            [db-quiz.state :refer [app-state]]
             [cljs-http.client :as http]
             [reagent.core :as reagent :refer [atom]]
             [cljs.core.async :refer [<! >! chan sliding-buffer]]

  (let [query-channel (http/get query-path {:channel (chan 1 (map :body))})
        sparql-results (sparql-results-channel)]
    (go
      (reset! loading? true)
      (let [query (render-template (<! query-channel) :data data)]
        ;(.log js/console query)
        (>! sparql-results (<! (sparql-query-channel query))))
      (reset! loading? false))
    sparql-results))

(defn sparql-autocomplete

(defn wrap-load
  [input-channel output-channel]
  (go
    (swap! app-state #(assoc % :loading? true))
    (>! output-channel (<! input-channel))
    (swap! app-state #(assoc % :loading? false)))
  output-channel)

(defn sparql-query
