 
 (enable-console-print!)
 
-(defonce app-state (atom {}))
+(defonce app-state (atom {:title "Org UI"
+                          :data {}}))
 
 (defn uuid []
   (uuid-string (make-random-uuid)))

    om/IWillMount
    (will-mount [_]
      (send-msg! {"id" (uuid)
                  "command" "list"} println))
    om/IRender
    (render [_]
      (html
       [:div.container
        [:div.page-header
         [:h1 "Org UI"]]]))))

(defn main []
  (setup-connection)

(defn receive-msg! [server-ch]
  (go-loop []
    (let [{:keys [message]} (<! server-ch)
          message (clojure.walk/keywordize-keys message)
          {:keys [in-response-to data]} message]
      (when-let [handler (get @requests in-response-to)]
        (handler data)
        (swap! requests dissoc uuid))
      (recur))))
