Fork me on GitHub
#om
<
2017-05-11
>
matthavener01:05:25

cp: in your parser mutation function, you can return a modified ast

matthavener01:05:56

@dehli: so return something like this: {:remote (assoc (:ast env) :params (deref (:state env))}

matthavener01:05:22

that would attach the entire app state to the remote mutation.. but you could cut that down

dehli01:05:31

i'll give that a try, thanks a lot!

pedroteixeira12:05:09

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
       [email protected]))) 
anyone using such wrappers?

hlolli13:05:53

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.

snichme15:05:23

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

anmonteiro15:05:35

@snichme you're not showing your send function, but I suspect you're not passing the query as an argument in the send callback

anmonteiro15:05:26

Opened this which will allow you not to pass a query https://github.com/compassus/compassus/issues/29

snichme15:05:19

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

anmonteiro15:05:24

@snichme right, so try passing the query (`remote`) as the 2nd arg to cb

snichme15:05:59

ok, will try that, thanks

snichme16:05:55

that worked!

snichme18:05:48

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?

currentoor23:05:01

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.