 (defn sort-pokemon!
   "Sort complete list of pokemon by given key."
   [key]
-  (om/transact! reconciler `[(sort/pokemon {:key ~key})])
-  (om/transact! reconciler `[(sort/toggle-asc)]))
+  (om/transact! reconciler `[(sort/pokemon {:key ~key})]))
 
 (defn update-player!
   "Update the playerdata."


(defmethod mutate 'sort/pokemon
  [{:keys [state]} _ {:keys [key]}]
  {:action (fn [] (swap! state update-in [:pokemon] (fn [] (cond-> (sort-by (juxt key :individual_percentage :cp) (:pokemon @state))
                                                                  (:sort-asc @state) reverse))))})

(defmethod mutate 'sort/toggle-asc
  [{:keys [state]} _ {:keys []}]
  {:action (fn [] (swap! state update-in [:sort-asc] not))})

(defmethod mutate 'change/view
  [{:keys [state]} _ {:keys [view]}]

            :progress-running? false
            :player            {}
            :evolution-number  0
            :sort-asc          true}))

(declare get-pokemon-by-id)
(declare evolution-sum)
