If I wrap presentation in an extra element render is only called once:

(ns presenter.renderer.core
  (:require [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]))

(enable-console-print!)

(defn presentation [_ owner]

  (reify

    om/IInitState
    (init-state [_]
      {:idx 0})

    om/IDidMount
    (did-mount [_]
      (.addEventListener js/document "keyup" (fn [_]
                                               (om/set-state! owner :idx  1))))

    om/IRender
    (render [_]
      (println "render")
      (dom/div #js{:className "content"} "test2"))))

(defn main [pages _]
  (reify
    om/IRender
    (render [_]
      (om/build presentation pages))))


(om/root main [1 2 3 4 5 6 7 8]  {:target (. js/document (getElementById 
"app"))})



-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to