   :delete-tea
   (fn [app-db [_ id]]
     (ajax/GET (str "/api/teas/" id "/delete")
-              :error-handler (fn [response] (println "DELETE-TEA ERROR" response))
+              :error-handler (fn [response] (println "DELETE-TEA ERROR " response))
               :handler #(re-frame/dispatch [:process-delete]))
     app-db))
 
+;; -- SAVE FOR TESTING ASYNC DOM UPDATE --
 ;(re-frame/register-handler
-  ;:update-tea
-  ;(fn [app-db [_ id new-name]]
-    ;(.setTimeout js/window #(ajax/GET (str "/api/teas/" id "/update/" new-name)
-                                  ;:error-handler (fn [response]
-                                                  ;(println "UPDATE-TEA ERROR" response))
-                                  ;:handler (fn [response] (println response))) 4000)
-    ;app-db))
+;:update-tea
+;(fn [app-db [_ id new-name]]
+;(.setTimeout js/window #(ajax/GET (str "/api/teas/" id "/update/" new-name)
+;:error-handler (fn [response]
+;(println "UPDATE-TEA ERROR" response))
+;:handler (fn [response] (println response))) 4000)
+;app-db))
 
 (re-frame/register-handler
   :update-tea
   (fn [app-db [_ id new-name]]
     (ajax/GET (str "/api/teas/" id "/update/" new-name)
-      :error-handler (fn [response]
-                      (println "UPDATE-TEA ERROR" response))
-      :handler (fn [response] (println response)))
+              :error-handler (fn [response]
+                               (println "UPDATE-TEA ERROR " response))
+              :handler (fn [response] (println response)))
     app-db))
 
 

    (fn []
      (println @tmp-new-tea)
      [:div.row
        [:div.col-md-12
          [:input.form-control {:type "text"
                                :placeholder "Name of New Tea"
                                :value @tmp-new-tea
                                :on-change #(re-frame/dispatch [:new-tea-entry (value-event %)])}]
          [:input.btn.btn-primary {:type "button"
                                   :value (str "Add " @tmp-new-tea)
                                   :on-click #(println "button clicked")}]]])))

;;(post-to-teas-db @tmp-new-tea)

;(defn tea-edit
  ;"The edit/delete form component"
  ;[]
  ;(fn []
    ;[:div.form-group
     ;[:div.row [:div.col-md-12]
       ;[:button.btn.btn-info {:on-click (fn [_] (swap! show-edit not))} "Show/Hide edit form"]
       ;[:div.p (str "Preview: " (or @edit-tea-snap "*no tea selected*") " -> " (or @edit-tea "*no tea selected*"))]
       ;[:div.p]
       ;[:form {:style {:visibility (if @show-edit
                                     ;"visible"
                                     ;"hidden")}}
        ;[:input.form-control {:field :text :id :change-tea :value @edit-tea :on-change sync-edit-tea
         ;[:input.btn.btn-info {:type "submit" :value "Update Tea Name" :on-click #((update-tea @edit-tea-id @edit-tea))}]
                                                                                  ;(reset! edit-tea nil)
                                                                                  ;(reset! edit-tea-snap nil)}]]
       ;[:input.btn.btn-danger {:type "button" :value (str "Delete " @edit-tea-snap) :on-click #(delete-tea @edit-tea)}]]]))

;; tea-edit can be re-written so that it will look like the tea is being
;; modified in place on the DOM -- as a sort of preview -- then once the
;; update button is clicked, the result can be sent to the db.

;; this passes the value of the new tea atom into the post-to-teas-db function

(defn list-page []
  [:div.container

    (fn [tea]
      (if @edit?
        [:tr
         [:td
          [:input.form-control {:type "text"
                                :value @tmp-edit
                                :on-change #(reset! tmp-edit (value-event %))}]
          [:button.btn.btn-success.pull-right
           {:on-click (fn [e]
                        (re-frame/dispatch
                          [:replace-tea tea @tmp-edit])
                        (swap! edit? not))}
           "Finalize"]]]
        [:tr
         [:td.pull-left {:on-click #(swap! edit? not)} (:name tea)]]))))

(defn tealister
  "The page component for listing tea"
