 (def app-state
   (atom {:canvas {:dimensions {:width 800 :height 400}
                   :actions []}
-         :tools {:width 4
+         :tools {:lineWidth 4
                  :strokeStyle "#000000" }}))
 
 (defprotocol Drawable

    (.restore context)))

(defn new-line-action []
  (->LineAction [] {:strokeStyle (get-in @app-state [:tools :strokeStyle])
                    :lineCap "round"
                    :lineJoin "round"
                    :lineWidth (get-in @app-state [:tools :width])}))
(def line-tool
  (reify
    ITool

    (render [_]
      (dom/div nil
               (apply dom/select
                      #js {:value (:lineWidth tools)
                           :onChange (fn [e]
                                       (let [newval (.-value (.-currentTarget e))]
                                         (om/update! tools [:lineWidth] newval)))}
                      (map (fn [i]
                             (dom/option #js {:value i} i))
                           (range 1 11)))
