                   new-closers))))))
 
 (defn- id->fbref [id]
-  (walk-root root [:item (str id)]))
+  (walk-root root :item (str id)))
 
 (defn- fb->chan
   ([fbref]


(defonce root (js/Firebase. url))

(defn- walk-root [r keys]
  (let [[k & ks] keys]
    (if ks
      (recur (.child r (clojure.core/name k)) ks)
      (.child r (clojure.core/name k)))))

(def top-stories (walk-root root [:topstories]))

(def ^:dynamic closer-root nil)


(defn r-item-binder [f]
  (fn [data path msg]
    (let [[event key val] msg
          child-path (conj path key)
          add-change-fn #(do
                           (swap! data assoc-in child-path val)
                           (when (= key :kids)
                             (doseq [id val]
                               (f id))))]
      (case event
        :child_added (add-change-fn)
        :child_changed (add-change-fn)
        :child_removed (swap! data update-in path dissoc key)
        (.log js/console (clj->js [event key val]))))))

