rename root-node to root-note!

This commit is contained in:
Artur Girenko 2016-02-11 21:42:59 +01:00
parent 055e123476
commit f9317c7698
2 changed files with 3 additions and 4 deletions

View File

@ -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 []

View File

@ -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]