Hello, how can I shuffle an om/props ?
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
So I'm trying to shuffle some section of my nf-app-state-atom but only once per page load if possible...
Let me know if I'm not making any sense / need more info
@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/
Well thank you kindly @drcode
that's actually a really slick idea
now that i see how he does it in the video
thx again
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)
@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...
Is there a way to trigger a re-read of the entire app query (without a reference to the root component)?
@peeja Wouldn’t you be able to access the root component by combining om.next/get-reconciler
and om.next/app-root
?
@dirklectisch Oh! Yes, that'll work just fine. I didn't see app-root
. Thanks!
@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