This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-20
Channels
- # beginners (43)
- # boot (44)
- # chestnut (17)
- # cider (78)
- # cljs-dev (24)
- # cljsrn (16)
- # clojure (84)
- # clojure-dusseldorf (1)
- # clojure-italy (21)
- # clojure-losangeles (2)
- # clojure-russia (140)
- # clojure-sg (2)
- # clojure-spec (8)
- # clojure-uk (16)
- # clojurescript (23)
- # cursive (7)
- # datascript (1)
- # datomic (18)
- # docker (20)
- # ethereum (1)
- # fulcro (16)
- # garden (4)
- # graphql (27)
- # hoplon (9)
- # jobs (4)
- # luminus (34)
- # off-topic (6)
- # om (4)
- # onyx (35)
- # pedestal (3)
- # re-frame (24)
- # ring-swagger (15)
- # rum (6)
- # shadow-cljs (22)
- # spacemacs (8)
- # specter (22)
- # yada (7)
Hello people, I would like to ask your opinion on something. Over the internet when we see Om.next code examples, most of then (all that I saw) demonstrate the creation of idents as [:group/by-id]
, [:user/by-email]
, always with the -by
pattern. Recently I was trying something different, and did remove the by-
, and some notable differences are: in some cases I can just use it directly as a Datomic lookup ref; it makes easier to translate in query fields. In summary, by removing the by-
I feel like I had one less translation step to do. So I wonder how are you defining your component idents? Are you using the by-
pattern? Did anybody tried to use a generic :db/id
for everything?
@wilkerlucio I use the by-
pattern. I’ve thought a bit about switching to match datomic’s lookup refs, but I’m kind of uncomfortable about having a property that looks exactly like the dictionary of its own parent. I’m not keen on :db/id
because you lose information on what the thing is. For example, for a client project, because of oracle, we have to rely on combination fields to convey identity, so I have to do something like [foo/by-path [0 2 :bar 4]]
if there are several components that make use of “paths”, then it’s useful to know what object it is.
@levitanong interesting, makes total sense when using tables where the identities are clear