     (go (let [response (<! (POST "/data/decks/" data :json))]))))
 
 (defn handle-edit [event owner]
-  (let [deck (-> owner (om/get-node "deck-edit") .-value)]
-    (om/set-state! owner [:deck :cards] (parse-deck deck))))
+  (let [text (-> owner (om/get-node "deck-edit") .-value)]
+    (om/set-state! owner :deck-edit text)
+    (om/set-state! owner [:deck :cards] (parse-deck text))))
 
 (defn decklist-view [{:keys [name identity cards]} owner]
   (om/component

                (not (#{"Special" "Alternates"} (:setname %)))
                (= (:type %) "Identity")) (:cards @cb/app-state)))

(defn edit-deck [owner]
  (om/set-state! owner :edit true)
  (-> owner (om/get-node "viewport") js/$ (.css "left" -500)))

(defn new-deck [side owner]

             [:input.lookup {:type "text" :placeholder "Card" :value (:card-search state)}] " x "
             [:input.qty {:type "text" :value (:quantity state)}]
             [:button {:on-click #()} "Add"]]
            [:textarea {:ref "deck-edit" :value (:deck-edit state)
                        :on-change #(handle-edit % owner)}]]]]]]))))

(om/root deck-builder app-state {:target (. js/document (getElementById "deckbuilder"))})

