I have a function that does some data manipulations and returns {:value ,,, :remote ,,,}
, it’s kind of “generic” it fits for most of the cases. I call it from my “read” methods, e.g:
(defn app-data-read [env k params] ,,,,,
{:value ,,, :remote ast})
(defmethod read :foo
[env k params]
(app-data-read env k params))
now what if in another method I need to reuse the output of add-data-read and manipulate some more?
how do I do that? Maybe it’s just wrong to have the sort of “indirection” as app-data-read
?
because something like this won’t work:
(defmethod read :bar
[env k params]
(let [v (app-data-read env k params)]
(assoc-in v [:value :data :bar-data] 42)))
oh, wait… no it actually works
@ag yea it should work, I don’t see a reason why it shouldn’t….
as long as it’s a pure function it shouldn’t matter how many function calls there are
Sorry, I got confused myself (again)
haha np 🙂 it happens to everyone
hello, I'm having an issue with advanced compilation, this is the error: Rl {message: "Invalid join, {:app/search-form nil}", data: n, ag: null, name: "Error", description: undefined…}
it seems like I can't get the query after advanced compilation, when I try (js/console.log "Root" (pr-str (om/get-query Root)))
, it returns nil
for the query
is there any known caveat about this on advanced compilation?
wilkerlucio: are you doing anything fancy with your cljs build process?
@matthavener I don't think so, this is what my compilation setup looks like:
{:id "production"
:source-paths ["src/client"]
:jar true
:compiler {:asset-path "js/prod"
:main mortician-gui.main
:optimizations :advanced
:output-dir "resources/public/js/prod"
:output-to "resources/public/js/mortician_gui.min.js"}}
ah ok, there’s a known bug that breaks get-query
if you build after requiring om.next
but that doesn’t look like its happening there
what you mean building after requiring om.next
?
I think the bug also assert
s on get-query
anyways, I don’t remember it returning nil
ah like if you run the cljs builder inside the JVM after doing other things. Instead of running it via lein-cljsbuild
also, if I try to (om/query Root)
it get's me Uncaught Error: No protocol method IQuery.query defined for type function: function (){React.Component.apply(this,arguments);this.state=null!=<http://this.Lc?this.Lc():{};return|this.Lc?this.Lc():{};return> this}
Are there any examples of SSR with compassus besides the tests.cljc file in the compassus repo?
@devo I don’t think so, no
BTW, Compassus SSR doesn’t work with the very last Om Next release
so you need to use alpha47 for now
I’ve been meaning to look into that, but still haven’t had the time
No worries. Been having issues merging in state correctly when rendering a compassus app server side. Will just keep tinkering with it.