Re: [ClojureScript] OM: issue with build & component types

2014-01-20 Thread David Nolen
On Mon, Jan 20, 2014 at 6:32 PM, kovas boguta wrote: > On Mon, Jan 20, 2014 at 1:58 PM, David Nolen > wrote: > > > The issue is that Om is extremely lazy, we don't even know what we have > > until we see that we need to update. > > I don't understand the issue here, unless its a quirk of React. >

Re: [ClojureScript] OM: issue with build & component types

2014-01-20 Thread kovas boguta
On Mon, Jan 20, 2014 at 1:58 PM, David Nolen wrote: > The issue is that Om is extremely lazy, we don't even know what we have > until we see that we need to update. I don't understand the issue here, unless its a quirk of React. If React is rendering the component, that means shouldComponentUpd

Re: [ClojureScript] OM: issue with build & component types

2014-01-20 Thread David Nolen
On Mon, Jan 20, 2014 at 2:42 PM, kovas boguta wrote: > Sounds like a reasonable solution for now, thanks. > > Is there a reason that the component type should be associated via the > build function, rather than as a protocol method? > The issue is that Om is extremely lazy, we don't even know wha

Re: [ClojureScript] OM: issue with build & component types

2014-01-20 Thread kovas boguta
On Mon, Jan 20, 2014 at 9:18 AM, David Nolen wrote: > Ok I think I see the problems you are encountering. But I don't see how this > isn't solved by making the mutimethod return the right *function*. It's a Sounds like a reasonable solution for now, thanks. Is there a reason that the component t

Re: [ClojureScript] OM: issue with build & component types

2014-01-20 Thread David Nolen
Ok I think I see the problems you are encountering. But I don't see how this isn't solved by making the mutimethod return the right *function*. It's a little bit more work and it means you'll have to repeat an argument or two in your use of om.core/build but I think this is workable: (om.core/buil

Re: [ClojureScript] OM: issue with build & component types

2014-01-20 Thread David Nolen
On Sun, Jan 19, 2014 at 9:27 PM, kovas boguta wrote: > My workaround is to set! .-constructor of the object returned from build, > but this is pretty ugly and requires additional bookkeeping, like creating > unique objects to correspond to the tags. > > Is there a better way to do this? > What's

[ClojureScript] OM: issue with build & component types

2014-01-19 Thread kovas boguta
There seems to be a problem with using multimethods (and presumably protocols) as the function passed to build. In particular, lifecycle methods will not be properly invoked after the initial render. The cause of the problem is that build identifies the "component type" as the function passed