 (defmethod step :dec [m]
   (swap! app-state update :count dec))
 
+(defmethod step :inc2 [m]
+  (swap! app-state update :count2 inc))
 
+(defmethod step :dec2 [m]
+  (swap! app-state update :count2 dec))
+
+
+
+; VIEW HELPERS
 
 (defn on-change [msg-id]
   #(step {:id msg-id

  #(step {:id msg-id}))


(defn greeting []
  (.log js/console "render greeting")
  [:div
   [:h1 (:text @app-state)]
   [:input 
    {:on-change (on-change :change-text)
     :value (:text @app-state)}]
   [:h2 (str "count " (:count @app-state))]
   [:button 
    {:on-click (on-click :inc)}
    "+"]
   [:button 
    {:on-click (on-click :dec)}
    "-"]])

(reagent/render [greeting] (js/document.getElementById "app"))

  (fn [{:keys [id]}]
   id))


;; UPDATE
(defmethod step :change-text [m]
  (swap! app-state assoc :text (:text m)))

