I have the following simple code. If a or s is pressed the state changes. But 
why is render called twice ?

Regards
  Roger

(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"} "test"))))

(om/root presentation [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