   (:require [untangled.client.mutations :as m]
             [untangled.dom :refer [unique-key]]))
 
-(comment
-  (defmethod m/mutate 'nav/change-tab [{:keys [state]} k {:keys [target]}]
-    {:action (fn [] (swap! state assoc :app/current-tab [target :singleton]))}))
 
 (defn unload [state prev-target]
   (case prev-target

                      (update-in [:app/trending :singleton] dissoc
                                 :grid/gas-query-grid
                                 :graph/trending-graph
                                 ))
    state))


  (let [prev-target (first (get old-st :app/current-tab))
        new-state (-> old-st
                      (unload prev-target)
                      (load new-target)
                      (assoc :app/current-tab [new-target :singleton]))]
    new-state))

(defmethod m/mutate 'nav/load-tab [{:keys [state]} k {:keys [target]}]
  {:action (fn [] (swap! state change-tab target))})
