aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/tau/core.cljs
blob: 7665a2053fd23f9555e0a01f59df9975a5a6434e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(ns tau.core
  (:require
   ["react-dom/client" :as rdom]
   [reagent.core :as r]
   [re-frame.core :as rf]
   [tau.events :as events]
   [tau.routes :as routes]
   [tau.subs]
   [tau.views :as views]))

(defonce root (rdom/createRoot (.querySelector js/document "#app")))

(defn ^:dev/after-load mount-root
  []
  (rf/clear-subscription-cache!)
  (routes/start-routes!)
  (.render root (r/as-element [views/app])))

(defn ^:export init
  []
  (rf/dispatch-sync [::events/initialize-db])
  (mount-root))