[ClojureScript] Re: Question: Om, multimethod and local state

2014-08-02 Thread feng zhou
Looks like Om 0.7.0 solves this issue already, so we don't have to return functions instead or use condp anymore. On Wednesday, July 23, 2014 5:04:17 PM UTC+10, Adam Comella wrote: Instead of having the multimethods return components, you could have them return functions which return

[ClojureScript] Re: Question: Om, multimethod and local state

2014-07-21 Thread feng zhou
On Friday, July 18, 2014 2:02:54 AM UTC+10, Jarppe Länsiö wrote: I have this same problem. I thought multimethods would be great way to render different views in simple page app, so I wrote something like this: (def app-state {:view :login}) (defmulti render-view (fn [app owner]

[ClojureScript] Re: Question: Om, multimethod and local state

2014-07-17 Thread Jarppe Länsiö
I have this same problem. I thought multimethods would be great way to render different views in simple page app, so I wrote something like this: (def app-state {:view :login}) (defmulti render-view (fn [app owner] (:view app))) (defmethod render-view :login [app owner] (om/component

Re: [ClojureScript] Re: Question: Om, multimethod and local state

2014-07-17 Thread Daniel Kersten
Most likely you are hitting this limitation: https://github.com/swannodette/om/issues/178 Om uses the function to decide if it needs to unmount/mount components. Since the multimethod is always the same function (regardless of where it then dispatches to), Om does not know that the component has

[ClojureScript] Re: Question: Om, multimethod and local state

2014-07-17 Thread William Sommers
This might help, not too sure though: https://github.com/hackerschool/community/blob/master/client/src/community/core.cljs#L19-L24 On Thursday, July 17, 2014 12:02:54 PM UTC-4, Jarppe Länsiö wrote: I have this same problem. I thought multimethods would be great way to render different views