Re: [ClojureScript] Re: re-frame - register-sub has no effect when body uses a let-binding

2015-04-03 Thread Colin Yates
My insanity must be worse than I thought because I could swear it was working earlier! On 3 April 2015 at 20:45, AndyR andre.r...@gmail.com wrote: reaction is a macro that expands to evaluating the passed forms (here: 'v') within a function (make-reaction). I don't know the internals of

Re: [ClojureScript] Re: re-frame - register-sub has no effect when body uses a let-binding

2015-04-03 Thread Colin Yates
I see - thanks Andy. It is all magic until it clicks :) Sent from my iPhone On 3 Apr 2015, at 22:45, AndyR andre.r...@gmail.com wrote: Yes that's expected. The reaction captures deref's (look at the source of ratom.cljs and search for capture). So as long as you deref in your reaction

Re: [ClojureScript] Re: re-frame - register-sub has no effect when body uses a let-binding

2015-04-03 Thread Colin Yates
Here is an example that works and uses a let. I wonder if the reaction inside the let is making it work... (defn- render-one [state-key render-key db] (let [id (- [:add-patient/tree-state state-key] subscribe deref :selected-ids first

Re: [ClojureScript] Re: re-frame - register-sub has no effect when body uses a let-binding

2015-04-03 Thread AndyR
Yes that's expected. The reaction captures deref's (look at the source of ratom.cljs and search for capture). So as long as you deref in your reaction block you'll be fine. I'm not an expert on the reagent inner workings so I hope other correct me if I'm wrong :) On Friday, April 3, 2015 at