 
 (defn tracker-handler [dfn params]
   (fn [result dmap]
-    #_(println result dmap)
+    #_(.log js/console "tracker handler: " 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)]
+    #_(.log js/console "Update listeners " (pr-str listeners) (pr-str deps))
     (->> (keys listeners)
          (filter #(or (nil? %) (match-deps % deps))) ;; cheap consolidation
          (map (fn [k] (doseq [l (get listeners k)] (l store deps))))

  "Call in on-changes"
  [owner]
  (fn [listener dmap]
    (-> owner
        (clear-listener!)
        (save-listener! listener dmap))))

(defn derive-listener
  "Helper. Handle source listener events"
  [derive store deps]
  #_(.log js/console "Derive received: " (or (.-deps deps) deps))
  (let [cache (.-cache derive)
        param-set (set (invalidate! cache store deps))]
    (when-not (empty? param-set)
