om

Please ask the channel first, not @dnolen directly!
petterik 2017-05-04T13:15:23.189599Z

Found today that we can't close over locals in the clj version of ui.

(let [a 1]
  (ui Object (render [this] a)))
;; => CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context
Seems like it's not possible to close over locals vars with defrecord

carter.andrewj 2017-05-04T13:43:01.752297Z

Could you try something like (let [foo (ui Object (render [this] (:a this)))] (assoc foo :a "bar")) ?

petterik 2017-05-04T13:59:56.139531Z

ui returns a function which takes props and stuff, not an instance of the record:

(assoc (om/ui Object (render [this] (:a this))) :a 1)
ClassCastException clojure.lang.AFunction$1 cannot be cast to clojure.lang.Associative

petterik 2017-05-04T14:12:15.432444Z

Created a macro om-ui which defines vars and replaces the vars for new generated symbols in the body passed to om.next/ui: https://gist.github.com/petterik/28c2fff796edbf4aa12e0e043e9342b0