   (:import goog.History))
 
 ;; Link format: [[foo|blitz]]
+
+;; global extra channel for outer-Om comms
+ (def comm-alt (chan (sliding-buffer 1)))
 
 (secretary/set-config! :prefix "#")
 

(ns unfolds.core
  (:require-macros [cljs.core.async.macros :refer [go]]
                   [secretary.core :refer [defroute]])
  (:require [clojure.set :refer [union]]
            [clojure.string :refer [split]]
            [goog.events :as events]
            [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]
            [cljs.core.async :refer [put! chan <!]]

               (dom/button #js {:onClick #(add-item app owner)} "Add item")
               (apply dom/ul nil
                      (om/build-all visible-item-view
                                    (filter (fn [[i _]] (in? (:visible app) i))
                                            (:items app))))))))

;; TODO: Put action on channel and then do something there
(defroute "/notes/:id" {:as params}
  #_(om/transact! @app-state :hidden #(assoc % :item false))
  #_(om/transact! @app-state :current-item (fn [_] (:id params)))
  (js/console.log (str "Viewing item: " (:id params))))

(defn main []
  (om/root app-view
