om

Please ask the channel first, not @dnolen directly!
urbank 2017-07-11T07:24:47.833508Z

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

urbank 2017-07-11T07:25:21.843710Z

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

coetry 2017-07-11T16:21:58.843014Z

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

coetry 2017-07-11T16:22:19.855391Z

something along the lines of: https://zeit.co/blog/next3-preview

wilkerlucio 2017-07-11T17:19:52.912012Z

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

👍 3
coetry 2017-07-11T17:21:32.970818Z

cool cool

sundarj 2017-07-11T17:49:03.952785Z

im a little bit stuck

sundarj 2017-07-11T17:50:23.001539Z

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

sundarj 2017-07-11T17:51:06.027062Z

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)

sundarj 2017-07-11T17:53:09.101703Z

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

sundarj 2017-07-11T17:54:37.155627Z

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

sundarj 2017-07-11T17:55:31.188943Z

https://rawgit.com/sundarj/hiki/master/target/index.html you can see the running app here, if it helps

thosmos 2017-07-11T20:53:38.316364Z

@sundarj are you familiar with om/tree->db? https://github.com/omcljs/om/blob/master/src/main/om/next.cljc#L2035

sundarj 2017-07-11T21:01:59.591478Z

can that generate subtrees of the state?

sundarj 2017-07-11T21:03:46.647833Z

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

sundarj 2017-07-11T21:12:09.898939Z

i will try that, thanks for the pointer!