 
 (defn list-item [item owner]
   (reify
-    om/IRender
-    (render [_]
+    om/IRenderState
+    (render-state [_ {:keys [comm]}]
       (let [href (str (:id item))]
         (dom/a #js {:href href
-                    :onClick (fn [e]
-                               (.setToken history href)
-                               (.preventDefault e))
+                    :onClick (fn [e] (.preventDefault e) 
+                                     (put! comm [:navigate href]))
                     :className "list-link"}
                (dom/li nil (:title item)))))))
 
 (defn header [app owner]
   (reify
-    om/IRender
-    (render [_]
+    om/IRenderState
+    (render-state [_ {:keys [comm]}]
       (dom/header nil
         (dom/div nil (dom/button #js {:id "back-button" :className "transparent-button" :onClick #(.back js/history)} "Back"))
         (dom/div nil (dom/div #js {:id "header-title"} (if-let [current-channel (:current-channel app)]

                                                         "Virt")))
        (dom/div nil (dom/button #js {:id "new-button" :className "transparent-button"} "New"))))))

(defn main [app owner]
  (reify
    om/IRender
    (render [_]
      (dom/div nil
        (om/build header app)
        (let [list-items (if-let [current-channel (:current-channel app)]
                           (:children (find-in-vec [:id] current-channel (:channels app)))
                           (:top-level-channels app))]
          (apply dom/ul #js {:className "virt-list"}
            (om/build-all list-item (find-all-in-vec [:id] list-items (:channels app)))))))))

(om/root app-state main (.getElementById js/document "content"))

                    {:id 0xAA2 :title "hi3" :parent 0x001}
                    {:id 0x002 :title "howdy"}
                    {:id 0x003 :title "how's it goin"}]
         :current-channel nil
         :page :cosm-list}))


(defroute "/" []
