Why would triggering a mutation from a callback not rerender if you also call update-state!
in the same callback?
But not if you wrap the update-state!
in setTimeout
Are there any examples of using om for exporting static builds that can be deployed to something like s3?
something along the lines of: https://zeit.co/blog/next3-preview
@coetry this sounds more like a CLJS question than an Om, I guess in practice you can just generate a build in a single file and deploy 🙂 just a hint, you can do this in CLJS: (defn ^:export some-fn [] ...)
, this will prevent the function name to be mangled or removed on the advanced output 😉
cool cool
im a little bit stuck
how do you normalize data you get from a third-party api, if you do?
it does into the state, but the problem is it's not normalized, so i've ended up with state that's both denormalized and normalized at the same time (in different places)
https://github.com/sundarj/hiki/blob/master/src/cljs/hiki/core.cljs the problem is the playlists/set-playlists mutation, which does a simple assoc
on the state, instead of an assoc-in
by ref
(:playlists, after that mutation, becomes a vector of maps)
https://rawgit.com/sundarj/hiki/master/target/index.html you can see the running app here, if it helps
@sundarj are you familiar with om/tree->db
? https://github.com/omcljs/om/blob/master/src/main/om/next.cljc#L2035
can that generate subtrees of the state?
i was under the impression it can only be used to generate the entire state tree
i will try that, thanks for the pointer!