   "Call in on-changes"
   [owner]
   (fn [listener dmap]
+    #_(.log js/console "Got subscribe callback: " (pr-str dmap))
     (-> owner
         (clear-listener!)
         (save-listener! listener dmap))))


(defn tracker-handler [dfn params]
  (fn [result dmap]
    #_(println result dmap)
    (doseq [[store deps] dmap]
      (ensure-subscription dfn store))
    (add-value! (.-cache dfn) params result dmap)))

(defn notify-listeners [store deps]
  (let [listeners (.-listeners store)]
    (->> (keys listeners)
         (filter #(or (nil? %) (match-deps % deps))) ;; cheap consolidation
         (map (fn [k] (doseq [l (get listeners k)] (l store deps))))

     (when (tracking?)
       (inform-tracker *tracker* store args)))
  ([tracker store args]
     #_(.log js/console "Informing tracker: " args " t? " *tracker*)
     (depends! tracker store (if (set? args) args #{args}))))


