 
 (defn edit-deck [owner]
   (om/set-state! owner :edit true)
-  (om/set-state! owner :deck-edit (deck->str (om/get-state owner [:deck :cards])))
+  (deck->str owner)
   (-> owner (om/get-node "viewport") js/$ (.addClass "edit"))
   (go (<! (timeout 500))
       (-> owner (om/get-node "deckname") js/$ .focus)))

    om/IInitState
    (init-state [this]
      {:edit false
       :add-channel (chan)
       :deck nil})

    om/IWillMount
    (will-mount [this]
      (let [add-channel (om/get-state owner :add-channel)]
        (go (while true
              (let [line (<! add-channel)]
                ;; (println line)
                (-> ".deckedit textarea" js/$ (.append line))
                (handle-edit owner))))))

    om/IDidUpdate
    (did-update [this prev-props prev-state]

        [:form.card-search {:on-submit #(handle-add owner %)}
         [:input.lookup {:type "text" :placeholder "Card" :value (:query state)
                         :on-change #(om/set-state! owner :query (.. % -target -value))
                         :on-key-down #(handle-keydown owner %)}]
         " x "
         [:input.qty {:type "text" :value (:quantity state)
                      :on-change #(om/set-state! owner :quantity (.. % -target -value))}]
         [:button "Add to deck"]
