diff --git a/resources/cljs-om-next/core.cljs b/resources/cljs-om-next/core.cljs index cf3d254..319e3f9 100644 --- a/resources/cljs-om-next/core.cljs +++ b/resources/cljs-om-next/core.cljs @@ -16,7 +16,6 @@ '[:app/msg]) Object (render [this] - (.log js/console "rendering app") (let [{:keys [app/msg]} (om/props this)] (view {:style {:flexDirection "column" :margin 40 :alignItems "center"}} (text {:style {:fontSize 30 :fontWeight "100" :marginBottom 20 :textAlign "center"}} msg) @@ -26,7 +25,7 @@ :onPress #(alert "HELLO!")} (text {:style {:color "white" :textAlign "center" :fontWeight "bold"}} "press me")))))) -(defonce RootNode (sup/root-node 1)) +(defonce RootNode (sup/root-node! 1)) (defonce app-root (om/factory RootNode)) (defn init [] diff --git a/resources/cljs-om-next/support.cljs b/resources/cljs-om-next/support.cljs index 8ea56f9..b38fcf0 100644 --- a/resources/cljs-om-next/support.cljs +++ b/resources/cljs-om-next/support.cljs @@ -1,9 +1,9 @@ (ns re-natal.support (:require [om.next :refer-macros [ui]])) -(def root-nodes (atom {})) +(defonce root-nodes (atom {})) -(defn root-node +(defn root-node! "A substitute for a real root node (1) for mounting om-next component. You have to call function :on-render and :on-unmount in reconciler :root-render :root-unmount function." [id]