             [clojure.string :refer [trim-newline]]
             [om-tools.dom :as dom :include-macros true]
             [cljs.core.async :refer [<! put! chan]]))
+
+
+(defn put-to-chan
+  [chan & args]
+  (fn [e]
+    (apply put! chan args)))
 
 (defn project
   "Om component for new project"

      (dom/div
       (dom/div {:className "projects-title"}
                (dom/h1 "Projects")
                (dom/button {:type "button" :onClick (fn [e] (put! edit-mode true))} "Edit"))
       (dom/ul {:className (when (:edit-mode data) "edit")}
               (om/build-all project
                             (filter #(or (:edit-mode data) (:enabled (second %))) (:projects data))

              display_name
              (dom/div {:className "editor"}
               (dom/label "Enabled: "
                          (dom/input {:type "checkbox" :checked enabled :onChange (put-to-chan disable project)}))
               (dom/label "Color: "
                          (dom/input {:type "color" :value color :onChange (fn [e] (put! color-chan [project (.-value (.-target e))]))})))))))

