om

Please ask the channel first, not @dnolen directly!
2017-10-10T09:26:48.000206Z

Probably performance? I think most JS engines are highly optimized for parsing json on the client side?

2017-10-10T09:27:02.000242Z

I don't hear of many people using messagepack, except server to server

ThadIsNOTFood 2017-10-10T20:45:02.000504Z

Hi can someone help tell me what I am doing wrong?

(defn get-devices-and-scenes [param1 data]
  (let [cursor (om/root-cursor data)]
    (om/transact! cursor :current-devices  (:space/devices param1))
    (om/transact! cursor :current-scenes (:space/scenes param1))
    (println "#####devices: " (app-state :current-devices))))
param1 is a map, data is a referred app-state I need to update app-state to hold the new information on :current-devices and :current-scenes

2017-10-10T22:26:10.000221Z

@thaddeus.aid this seems like a weird fn (i.e. get- prefix but then writing to the app-state). data is an atom, right?

(defn get-devices-and-scenes [param1 data]
  ;data is an atom, right? (e.g. not derefed)
  (let [cursor (om/root-cursor data)]
    (om/transact! cursor #(assoc % :current-devices (:space/devices param1)
                           :current-scenes (:space/scenes param1)))
    (println "#####devices: " (@cursor :current-devices))))

ThadIsNOTFood 2017-10-10T22:42:56.000178Z

@rbertrand thanks! can I ask what the #() and asoc % symbolize? I'm still fairly new to this.

ThadIsNOTFood 2017-10-10T22:45:25.000409Z

Error: No protocol method ISwap.-swap! defined for type om.core/MapCursor: [object Object] I guess I will need to import that

2017-10-10T22:47:20.000330Z

@thaddeus.aid it’s a reader macro - https://clojure.org/reference/reader (for the #and % explanation, see Macro characters > Dispatch (#) > Anonymous function literal)

ThadIsNOTFood 2017-10-10T22:47:34.000059Z

thanks!