Re: [ClojureScript] Re: Om opts is ignored, why?

2014-12-12 Thread Daniel Kersten
To see why you cannot pass changing information in opts: The Om component function returns a reified instance of the protocols: (defn my-component [app owner opts] (reify om/IRender (render [_] (dom/div nil (:foo opts The first time om/build is called with this and opts is passed

Re: [ClojureScript] Re: Om opts is ignored, why?

2014-12-12 Thread Andrew
Thanks Daniel. By the way, would it be considered acceptable to pass a map to build or build-all that contains both :state and :init-state, maybe :opts as well? Or it is more idiomatic to use just one of these in your build function. As there may be data that will change, and data that will

[ClojureScript] Re: Om opts is ignored, why?

2014-12-11 Thread jack james
The best way to get help with this is to post (gist, refheap, or similar) a complete but minimal case that demonstrates the issue. Here's an example that you may find helpful that includes (a contrived use of) build-all, opts, and render-state: https://www.refheap.com/94767 On Thursday,

Re: [ClojureScript] Re: Om opts is ignored, why?

2014-12-11 Thread David Nolen
You cannot put changing information in :opts. David On Thu, Dec 11, 2014 at 5:14 PM, Andrew andrew...@gmail.com wrote: Thanks, here's code that demonstrates the problem. It's your code with two modifications: edit is in component local state, not app state. And I have a button to change

Re: [ClojureScript] Re: Om opts is ignored, why?

2014-12-11 Thread Andrew
Ah, I see! Many thanks. I thought on a re-render the build-all would be sent again and opts evaluated again. I skimmed the documentation for info on this but didn't see anything. This is great to know. I guess that solves the state vs opts debate for me! -- Note that posts from new members