 (ns derive.main
-  (:require-macros [derive.deps :refer [defn-derived]])
+  (:require-macros [derive.deps :refer [defn-derived with-tracked-dependencies]])
   (:require [clojure.core.reducers :as r]
             [figwheel.client :as fw :include-macros true]
             [om.core :as om :include-macros true]

    om/IRender
    (render [_]
      (let [db (om/get-shared owner :db)]
        (html
         [:div
          [:h3 "Om Application"]
          [:p (derive-text db (inc (:current app)))]
          [:button {:on-click #(om/transact! app :current (inc-mod 4))} "Next"]])))))

;;
;; Setup and Lifecycle Management

       (d/sort (comparator >))
       (reduce + 0)))

(defn-derived derive-text
  [db id]
;  (let [tracker nil #_(default-tracker)]
;    (fn [db id]
;      (binding [*tracker* nil #_(tracker db [id] *tracker*)]
  (println "Computing Text")
  (str (:text (db id))  " [" (derive-count db (inc id)) "]"))

(defn inc-mod [modulus]
  (fn [old]
