     (do (js/console.log "unknown cmd" cmd)
         state)))
 
-(defonce state-ref (atom nil))
+(defonce state-ref
+  (atom {}))
 
 (defn ws-loop []
   (go (loop []

   :padding-left 10})

(defstyled editor-container :div [_]
  {:height 200})

(defstyled html-toolbar :div [_]
  {:padding 10
   :font-weight "bold"})

(defn ui []
  (html-container
    (html-toolbar
      "[ALPHA] shadow-cljs REPL")

    (term-container {:ref attach-terminal})
    (editor-container
      (html/input {:ref attach-codemirror}))))

(defn ^:dev/after-load start []
  (let [cmd-in

                      (.send ws (pr-str msg))
                      (recur))))

              (rd/render (ui @state-ref) dom-target)

              (add-watch state-ref
                ::render
                (fn [_ _ new-val old-val]
                  (rd/render (ui new-val) dom-target)))

              (ws-loop)

