(ns chicken-master.core (:require [reagent.dom :as rdom] [re-frame.core :as re-frame] [chicken-master.events :as events] [chicken-master.views :as views] [chicken-master.config :as config] )) (defn dev-setup [] (when config/debug? (println "dev mode"))) (defn ^:dev/after-load mount-root [] (re-frame/clear-subscription-cache!) (let [root-el (.getElementById js/document "app")] (rdom/unmount-component-at-node root-el) (rdom/render [views/main-panel] root-el))) (defn init [] (re-frame/dispatch-sync [::events/initialize-db]) (re-frame/dispatch-sync [::events/show-from-date (new js/Date)]) (dev-setup) (mount-root))