             [cljs-time.coerce :as dt2]))
 
 (enable-console-print!)
+
 (def raw-data [
                {
                 :id "m_1"

      ))
  )

(defui ThreadSection
  static om/Ident
  (ident [this {:keys [thread/id]}]
         [:threads/by-id id])
  Object
  (render [this]
          (dom/div #js{:className "thread-section"}


(def thread-section (om/factory ThreadSection))

(defui ChatApp
  static om/IQuery
  (query [this]
         [{:threads (om/get-query ThreadSection)}])
  Object
  (render [this]
          (let [{:keys [threads]} (om/props this)]
            (dom/div #js{:className "chatapp"}
                     (thread-section threads)
                     (message-section (last threads))))))

(defmulti read om/dispatch)

(defmethod read :default
  [{:keys [state] :as env} k _]
  (let [st @state]
    (if (contains? st k)
      {:value (get st k)}
      {:remote true})))


(def reconciler
  (om/reconciler {:state {:threads (reduce threads [] raw-data)}
