Fork me on GitHub
#om
<
2017-07-18
>
matan05:07:39

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

danielstockton07:07:03

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

matan08:07:55

@danielstockton thanks good to know 🙂

danielstockton14:07:56

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?

matan15:07:59

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)

danielstockton15:07:01

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

danielstockton15:07:47

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

danielstockton15:07:07

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

matan15:07:15

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

matan15:07:46

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

claudiu15:07:36

@matan you could try like

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

wilkerlucio16:07:56

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

fenton16:07:12

Feedback welcome.

facundo20:07:34

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

facundo20:07:43

is that tutorial updated?

jcf22:07:36

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"},
 ;; ...

jcf22:07:07

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.

jcf22:07:58

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.

jcf22:07:33

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

jcf22:07:46

Is this something anyone else has seen before?