 (ns gc-api-browser.core
-  (:require-macros [cljs.core.async.macros :refer [go]])
+  (:require-macros [cljs.core.async.macros :refer [go-loop]])
   (:require [cognitect.transit :as transit]
             [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]

  (om/transact! app [:request :headers]
                (fn [headers] (if (empty? headers) default-headers headers))))

(defn tx-listener [sync-chan _ root-cursor]
  (async/put! sync-chan @root-cursor))

(defn main []
  (let [sync-chan (async/chan (async/sliding-buffer 1))
        throttled (throttle sync-chan 300)]
    (om/root
      (fn [app _]
        (reify

              (render-schema-select app)))))
      app-state
      {:target (.getElementById js/document "app")
       :tx-listen (fn [_ root-cursor]
                    (async/put! app-state-chan @root-cursor))})))
