 
 
 (def app-state
-  (atom {:state []}))
+  (atom {}))
+
+(defn refresh-navigation []
+;;   (
+;;    ;;let [token (.getToken history)
+;;    let [token "/employee/1"
+;;         set-active (fn [nav]
+;;                      (assoc-in [:state :active] (= (:path nav) token)))]
+
+;;    ;; #(map set-active %)
+;;    (swap! app-state #(map set-active %))
+;;    (println (str "token: " token))
+;;    (app-state))
+;;   (let [token "/employee/1"
+;;         set-active (fn [nav] (assoc nav :active (= (:path nav) token)))])
+;;   (swap! app-state #(map set-active %))
+)
+
+(refresh-navigation)
 
 (def history (History.))
 
-(defn refresh-navigation []
-   (
-     let [token (.getToken history)
-          set-active (fn [nav]
-                       (assoc-in nav [:state] :active (= (:path nav) token)))]
-
-    ;; #(map set-active %)
-    (swap! app-state #(map set-active %))
-    (println (str "token: " token))))
-
- 
 (defn on-navigate [event]
-  (refresh-navigation)
-  (secretary/dispatch! (.-token event)))
+  (refresh-navigation)
+  (secretary/dispatch! (.-token event)))
 
 (defroute "/employees/:id" [id]
   (println (str "employee id: " id )))
-
 
 (defn fetch-departments
   [url]


(defcomponent gravatar [email-address owner {:keys [size] :as opts}]
  (display-name [_]
    "gravatar")

  (render [_]
          (html

          (html
           [:div
            (->departments-container app
                                     {:opts {:url "http://localhost:3030/api/departments"
                                             :poll-interval 2000}})])))
(defn main []
  (doto history
    (goog.events/listen EventType/NAVIGATE on-navigate)
