    [:label "Your username: "]
    [username-input]
 
-   [:div#messages
-    (for [[message index] (map vector (take-last 30 @messages) (range))]
-      ^{:key (str "message-" index)}
-      [:div [:span.username (first message) ": "] [:span.message (second message)]])]
+   [show-messages]
 
    [message-form]])
 

              :on-change #(reset! message (-> % .-target .-value))}]
     [:button {:type "submit"} "Send"]]))

;; -- Views -----------------

(defn on-going-chat []

  (fn [db [_ username message chat-room]]
    (m/conj-in! fb-root [(-> chat-room (str/lower-case) (keyword))
                         :messages]
                {:username username
                 :message message})
    db))

;; -- View Components -------
