om

Please ask the channel first, not @dnolen directly!
matan 2017-07-18T05:30:39.220975Z

should I really be using clojure 1.7 for om.next? the tutorial seems to imply so but I hope it's not true

2017-07-18T07:55:03.345196Z

@matan you can use 1.8/1.9, I'm pretty sure that was just the stable version at the time the tutorial was published.

matan 2017-07-18T08:00:55.473834Z

@danielstockton thanks good to know 🙂

2017-07-18T14:30:56.262113Z

I have a read parser which modifies the ast before sending to backend (assoc-in [:params]). This works fine on the initial read but I noticed the params are missing when I trigger a subsequent read with (om/transact! this [:read/key]). I've verified the parser is still associng the params correctly. Anyone come across this?

matan 2017-07-18T15:00:59.503197Z

Am I the only one for which lighttable is unable to find the definition of #js as in

(dom/button
          #js {:onClick
               (fn [e]
                 (swap! app-state update-in [:count] inc))}
          "Click me!")))))
(from the om.next getting started)

2017-07-18T15:07:01.758131Z

@matan I'm not familiar with lighttable but #js is a tagged literal: https://cljs.github.io/api/syntax/#tagged-literal

2017-07-18T15:07:47.789459Z

It's not a function in the usual sense, it's a reader macro

2017-07-18T15:08:07.803329Z

Not sure what you're hoping to see as a definition.

matan 2017-07-18T15:18:15.220113Z

thanks @danielstockton I'm learning om.next in tandem with a re-cap of clojurescript, so this was helpful!

matan 2017-07-18T15:20:46.323411Z

So it's a special form implemented by the cljs compiler..

1👍
claudiu 2017-07-18T15:59:36.897191Z

@matan you could try like

(dom/div (clj->js {:onClick (fn [evt] ...) }))

wilkerlucio 2017-07-18T16:14:56.478186Z

@matan or (js-obj "onClick" (fn [evt] ...))

fenton 2017-07-18T16:35:33.229885Z

Wrote a beginner om-next tutorial. https://github.com/ftravers/missing-links

3
fenton 2017-07-18T16:36:12.252597Z

Feedback welcome.

2017-07-18T20:20:34.174571Z

hi! I’m following the basic tutorial on the om wiki and started to hit errors when I got to https://github.com/omcljs/om/wiki/Basic-Tutorial#rendering-a-list-of-things

2017-07-18T20:20:43.179509Z

is that tutorial updated?

jcf 2017-07-18T22:22:36.704711Z

Hi all. Quick question in case someone's seen this before… I have some data coming back from my server (using om.next.server) that's getting normalised and looking great!

{:session/user
 {:db/id 1,
  :user/email "[REDACTED]",
  :user/name "jcf",
  :user/uuid #uuid "5967e7c7-0053-4a83-95e4-51ad2ab19051"},
 :session/emails
 [[:email/by-id 17592186045423]
  [:email/by-id 17592186045424]
 ;; ...
:email/by-id
 {17592186045440
  {:db/id 17592186045440,
   :email/subject "2VVma6Cz6w1M92",
   :email/uuid #uuid "050d8769-8f2c-446b-bfe5-8cd3d3160e8c"},
  17592186045472
  {:db/id 17592186045472,
   :email/subject "83zSQGK6VLlPGAIPjm4HkFZ42uQPMnQsZ6",
   :email/uuid #uuid "7d7afd5b-9e38-4019-af20-663e7a4e35cc"},
 ;; ...

jcf 2017-07-18T22:24:07.736108Z

I'm happy with the :email/by-id bits showing up top-level and the idents in :session/emails. That looks right and gets passed onto the cb function provided by Om's send fn.

jcf 2017-07-18T22:24:58.754293Z

Problem is, the state that ends up in the reconciler is full of nils. The :session/email idents are all [:email/by-id nil], and there's a single {nil [:email/by-id 1111]} entry in the :email/by-id.

jcf 2017-07-18T22:25:33.766544Z

The single :email/by-id number is a real :db/id from Datomic.

jcf 2017-07-18T22:25:46.771092Z

Is this something anyone else has seen before?