 
 (defn mk-state
   [put-fn]
-  (atom initial-state))
+  (atom (initial-state)))
 
 (defn component
   [cmp-id]

  (local-storage (atom {:message-limit 500
                        :message-filters #{}}) :settings))

(defonce initial-state
  {
   ;; List of messages captured. Oldest first. When messages are filtered, they are
   ;; removed/not stored here.

(defn handle-new-messages
  "Analyzes new messages and appends them to the :messages list in a state."
  [{:keys [cmp-state msg-payload]}]
  (let [{:keys [view total-messages-count message-limit first-message-ts]} @cmp-state
        assign-message-idx (fn [total-count msgs]
                             (map-indexed #(assoc %2 :idx (+ %1 1 total-count)) msgs))
        messages (->> msg-payload
