om

Please ask the channel first, not @dnolen directly!
sova-soars-the-sora 2017-06-06T03:31:02.313959Z

Hello, how can I shuffle an om/props ?

sova-soars-the-sora 2017-06-06T03:32:16.322107Z

I tried doing (take 8 (shuffle (map blurblist (-> this om/props :blurbs)))) but that was hilarious ... as it would shuffle the whole set on every mouse move.. every pixel change on mouseOver triggered a shuffle + redraw

sova-soars-the-sora 2017-06-06T03:33:03.326954Z

So I'm trying to shuffle some section of my nf-app-state-atom but only once per page load if possible...

sova-soars-the-sora 2017-06-06T03:34:24.335242Z

Let me know if I'm not making any sense / need more info

drcode 2017-06-06T03:43:41.391811Z

@sova I'd put a random seed in app-state, then use one of gary fredericks' libraries to always shuffle the same way https://m.curiosity.com/videos/gary-fredericks-purely-random-clojuretv/

sova-soars-the-sora 2017-06-06T03:46:11.407245Z

Well thank you kindly @drcode

sova-soars-the-sora 2017-06-06T04:01:23.506432Z

that's actually a really slick idea

sova-soars-the-sora 2017-06-06T04:01:28.507111Z

now that i see how he does it in the video

sova-soars-the-sora 2017-06-06T04:01:33.507695Z

thx again

2017-06-06T16:11:42.364320Z

When handling references on the front end, do most of you work with the :db/id from datomic? I have a colleague that thinks datomic ids shouldn’t leave the server, and if you need to refer to a ref within datomic you should use a uuid. I don’t personally see a need to use uuids until I’m communicating with a separate system. (of course, there is the question of where that line begins)

sova-soars-the-sora 2017-06-06T18:38:59.813541Z

@uwo I use a roundabout way of updating my app-state-atom via socket communications, so I never actually know what the DB is on about...

👍 1
peeja 2017-06-06T18:46:32.989721Z

Is there a way to trigger a re-read of the entire app query (without a reference to the root component)?

dirklectisch 2017-06-06T18:57:40.249770Z

@peeja Wouldn’t you be able to access the root component by combining om.next/get-reconciler and om.next/app-root?

peeja 2017-06-06T18:59:09.284716Z

@dirklectisch Oh! Yes, that'll work just fine. I didn't see app-root. Thanks!

👍 1
drcode 2017-06-06T23:45:47.030648Z

@uwo The usual pattern is to assign a tempid on the client (OmNext has a function for this) then pushing the new item to the server, then the server generates a :db/id, finally the server sends a map of tempid->db/id to the client, which the client uses to get back in sync. So usually having db/ids on the client is normal