Fork me on GitHub
#om
<
2017-07-11
>
urbank07:07:47

Why would triggering a mutation from a callback not rerender if you also call update-state! in the same callback?

urbank07:07:21

But not if you wrap the update-state! in setTimeout

coetry16:07:58

Are there any examples of using om for exporting static builds that can be deployed to something like s3?

wilkerlucio17:07:52

@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 😉

sundarj17:07:03

im a little bit stuck

sundarj17:07:23

how do you normalize data you get from a third-party api, if you do?

sundarj17:07:06

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)

sundarj17:07:09

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

sundarj17:07:37

(:playlists, after that mutation, becomes a vector of maps)

sundarj01:07:51

it took some hammock & repl time, but i managed to get there in the end. thank you kindly for the help 🙂 https://github.com/sundarj/hiki/commit/99e1b8e4639f2a783d3a5286bbe61f1dff8bf05d

sundarj21:07:59

can that generate subtrees of the state?

sundarj21:07:46

i was under the impression it can only be used to generate the entire state tree

sundarj21:07:09

i will try that, thanks for the pointer!