 (defn create-msg [name text]
   {:text text :name name :date (js/Date.)})
 
-(def val-atom (atom {:messages [(create-msg "Greetings" "Chat42")]}))
+(def val-atom (atom {:messages [(create-msg "Replikativ.io" "Welcome!")]}))
 
 
 (defn start-local []

  Object
  (componentDidMount [this]
                     (.log js/console "will mount")
                     (om/set-state! this {:input-name "Chat42" :input-text "Hi"}))
  (render [this]
    (let [app-state (om/props this)
          {:keys [input-name input-text]} (om/get-state this)]

       [:div
        [:div
         [:input {:value input-name
                  :placeholder "Name"
                  :on-change
                  (fn [e]
                    (om/update-state! this assoc :input-name (target-val e)))}]
         [:input {:value input-text
                  :placeholder "Message"
                  :on-change (fn [e]
                               (om/update-state! this assoc :input-text (target-val e)))}]
         [:button {:on-click (fn [_]
                               (do
                                 (send-message! app-state (create-msg input-name input-text))
                                 (om/update-state! this assoc :input-text "")))} "Send"]]
        (map (fn [{:keys [text name date]}]
               [:p (str date ": " name " -> " text)])
             (:messages app-state))]))))
