Skip to content

Commit 7e66b5c

Browse files
committed
refactor mount fns
1 parent 8a4ece7 commit 7e66b5c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/renderer/core.cljs

+3-7
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,10 @@
7171

7272
(def root-el (atom nil))
7373

74-
(defn ^:dev/after-load ^:export after-load []
75-
(rf/clear-subscription-cache!)
76-
(when @root-el
77-
(ra.dom.client/render @root-el [error/boundary [app.v/root]])))
78-
79-
(defn mount-root! []
74+
(defn ^:dev/after-load mount-root! []
8075
(let [container (.getElementById js/document "app")]
81-
(reset! root-el (ra.dom.client/create-root container))
76+
(rf/clear-subscription-cache!)
77+
(when-not @root-el (reset! root-el (ra.dom.client/create-root container)))
8278
(ra.dom.client/render @root-el [error/boundary [app.v/root]])))
8379

8480
(defn bootstrap-cb!

0 commit comments

Comments
 (0)