This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-06
Channels
- # aleph (15)
- # beginners (40)
- # boot (14)
- # cider (90)
- # cljs-dev (132)
- # cljsrn (25)
- # clojars (7)
- # clojure (188)
- # clojure-chicago (4)
- # clojure-dusseldorf (1)
- # clojure-greece (9)
- # clojure-italy (43)
- # clojure-russia (16)
- # clojure-sg (7)
- # clojure-spec (39)
- # clojure-uk (81)
- # clojurescript (170)
- # component (5)
- # core-async (7)
- # cursive (49)
- # data-science (65)
- # datascript (3)
- # datomic (27)
- # graphql (3)
- # hoplon (4)
- # instaparse (56)
- # klipse (129)
- # leiningen (1)
- # lumo (28)
- # off-topic (4)
- # om (15)
- # onyx (54)
- # overtone (7)
- # pedestal (7)
- # re-frame (9)
- # reagent (72)
- # ring (33)
- # ring-swagger (2)
- # spacemacs (1)
- # untangled (19)
- # vim (2)
- # yada (12)
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