       (dom/div #js {:id "login-signup"}
                (dom/form #js {:id "login"
                               :style (display (= screen :login))}
-                         (input owner :email "Your username or email")
-                         (input owner :password "Your password" "password")
+                         (input :email "Your username or email"
+                                (handle-change owner :email))
+                         (input :password "Your password"
+                                (handle-change owner :password)
+                                "password")
                          (dom/button
                           #js {:onClick (fn [e]
                                           (.preventDefault e)

                                "or sign up"))
               (dom/form #js {:id "signup"
                              :style (display (= screen :signup))}
                         (input owner :username "Choose a username")
                         (input owner :email "Your email")
                         (input owner :password "Choose a password" "password")
                         (dom/button
                          #js {:onClick (fn [e]
                                          (.preventDefault e)

       :url "/boards"
       :chan ch})))

(defn input [id placeholder on-change & [type]]
  (dom/input #js {:type (or type "text")
                  :id (name id)
                  :onChange on-change
                  :placeholder placeholder}))

(defn handle-change [owner id]
  (fn [e]
    (let [new-value (.. e -target -value)]
      (om/set-state! owner id new-value))))

(defn login-view [app owner {:keys [on-login]}]
  (reify
