I've got a question about pro/cons of writing Om components in two different 
ways. The first way uses higher-order functions:

(defn input-component
  [{:keys [app-state-key class-name]}]
  (fn [data owner]
    (reify
      om/IRenderState
      (render-state [this state]
        ; ...

The second way uses the options argument: (borrowed from the instrument example 
in Om):

(defn something-else
  [original owner opts]
  (reify
    om/IRender
    (render [_]
      (dom/div #js {:style #js {:border "1px solid #ccc" :padding "5px"}}
        (dom/div nil
          (dom/span nil "Path:")
          (dom/pre #js {:style #js {:display "inline-block"}}
            (pr-str (om/path (second original)))))
        (apply om/build* original)))))

What are the pros/cons of the two approaches? Apologies if this is already 
written up somewhere -- if so, could you kindly point me to it?

For example, are there differences that affect rendering after state changes?

Thanks,
David

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