                                  res))}))
     om/IWillMount
     (will-mount [this]
-                (event-loop app owner))
+      (event-loop app owner)
+      (autocomplete-results-loop app owner))
     om/IRenderState
     (render-state [this state]
             (if (not (:connected app))

          nil)
        (recur (:event (<! ch-chsk))))))

(defn update-player-search [value app]
  (if (empty? value)
    (om/update! app :auto-complete-results [])
    (let [pattern (re-pattern value)
           results (filter
                     #(re-find pattern (clojure.string/lower-case %)) (:players app))]
        (om/update! app :auto-complete-results results))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


                          :events []
                          :connected false
                          :players []
                          :auto-complete-results []
                          :ac-chan (chan)}))

(defn submit-new-text [data owner]
  (let [new-text (-> (om/get-node owner "new-text") .-value)]
