cp: in your parser mutation function, you can return a modified ast
@dehli: so return something like this: {:remote (assoc (:ast env) :params (deref (:state env))}
that would attach the entire app state to the remote mutation.. but you could cut that down
i'll give that a try, thanks a lot!
sure
I'm struggling with defmacro
to wrap defui in om.next. it's more of a cljs doubt, but perhaps some has already seems this here: java.lang.Object does not declare method called render
. Was thinking something along:
(defmacro defcomponent [vname cfg & body]
`(do
(om/defui ^:once ~(symbol vname)
Object
~@body)))
anyone using such wrappers?macro over a macro, if you are feeding (render [this]..) into the body then maybe try om/ui
that's almost the same, just render.
ok thanks.
I have a problem with getting the data from the server normalized when I’m using compassus. If I just mount the app with om/add-root! and point to my root component the server response gets normalized but when I mount it via compassus/mount! the server response isn’t. I have figured out that the problem is that the root query isn’t correct when using compassus thus is doesn’t get normalized, but how am I suppose to do it? Here is my core.cljs as a reference: https://gist.github.com/snichme/101600b849dc7bcab17877a3310d4ad2
@snichme you're not showing your send function, but I suspect you're not passing the query as an argument in the send callback
Opened this which will allow you not to pass a query https://github.com/compassus/compassus/issues/29
Sorry, my send function is the same as the one you use in your fullstack example: https://github.com/anmonteiro/om-next-fullstack/blob/master/src/shared/todomvc/util.cljc#L18
@snichme right, so try passing the query (`remote`) as the 2nd arg to cb
ok, will try that, thanks
that worked!
awesome
So with compassus, how do you do to route to a specific item with id, for example /posts/123 I want to render the post with id 123 but I cannot setup ident routes for all because they are dynamic. Are there any examples of how to do this?
@snichme https://github.com/cmcfarlen/compassus-route-params check this out
Are there plans to get Om Next out of alpha? It’s a wonderful framework that I use in production everyday. Just seems strange that it’s still in alpha.