       {:display-name "autocomplete"
        :component-will-mount
        (fn [c]
+         (swap! state assoc :text @thread-text)
          (let [{:keys [config]} (r/props c)]
            (go (loop []
                  (let [[v ch] (alts! [throttled-autocomplete-chan kill-chan])]

        clear-force-close! (fn []
                             (swap! state assoc :force-close? false))

        set-text! (fn [text]
                    (dispatch! :new-message-text {:thread-id @thread-id
                                                  :content (.slice text 0 5000)}))

        update-text! (fn [f]
                       (dispatch! :new-message-text
                                  {:thread-id @thread-id
                                   :content (f @thread-text)}))

        choose-result!
        (fn [result]

                     (set-results!
                       (seq (mapcat (fn [e] (e v (config :thread-id))) engines)))
                     (highlight-first!)
                     (recur)))))
           (go (loop []
                 (let [[v ch] (alts! [throttled-thread-text-chan thread-text-kill-chan])]
                   (when (= ch throttled-thread-text-chan)
                     (dispatch! :new-message-text v)
                     (recur)))))))

       :component-will-update
       (fn [c [_ {new-config :config}]]
         (reset! thread-id (new-config :thread-id))
         (swap! state assoc :text @thread-text))

       :component-will-unmount
       (fn []
         (put! kill-chan (js/Date.))
         (put! thread-text-kill-chan (js/Date.)))

       :reagent-render
       (fn [{:keys [config textarea-view results-view]}]
