This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-14
Channels
- # beginners (31)
- # boot (9)
- # cider (10)
- # cljs-dev (9)
- # cljsrn (16)
- # clojure (222)
- # clojure-austin (4)
- # clojure-france (13)
- # clojure-italy (21)
- # clojure-nl (2)
- # clojure-russia (71)
- # clojure-spec (9)
- # clojure-uk (39)
- # clojurescript (50)
- # cursive (16)
- # datomic (69)
- # dirac (2)
- # figwheel (1)
- # graphql (19)
- # hoplon (4)
- # jobs (1)
- # klipse (3)
- # leiningen (4)
- # liberator (3)
- # luminus (9)
- # lumo (9)
- # off-topic (3)
- # om (21)
- # onyx (11)
- # parinfer (2)
- # pedestal (8)
- # planck (19)
- # re-frame (17)
- # reagent (12)
- # remote-jobs (1)
- # ring-swagger (3)
- # spacemacs (17)
- # specter (23)
- # sql (1)
- # unrepl (64)
- # untangled (19)
- # yada (5)
@mitchelkuijpers well, interestingly:
(def db {:root [:k 1]
:k {1 [:k 2]
2 {:x 1}}})
(om.next/db->tree [{:root [:x]}] db db)
; => {:root {:x 1}}
and when I look at the algorithm it does seem to be recursive in it’s treatment of idents. I still would not do it, myself, though. Seems to convolute the database too much.
but now the question is: since Om Next supports it, should our forms support as well
In a form we have an default value which I only know when the data is loaded. Because the values are configurable
So I want so set a ident somewhere to fill the default value when it's loaded
And I noticed indeed that it works in Om
I don’t see why that case just isn’t a post-mutation that puts the data where it needs to be…not sure why an ident is involved, much less two of them
if it is a field, why not just have a post-mutation on the default load that puts it into the field iff it isn’t filled. Same with a sub-form: fill in the fields with the defaults.
Yes that is how I fixed it now
A subform for a field
But now I have to load it and put it in place in the form otherwise it would just be at that place to reference when it is loaded
@mitchelkuijpers you do have to put it in place, but I don’t understand why that would lead to ident -> ident -> value