Fork me on GitHub
#untangled
<
2017-06-14
>
tony.kay06:06:20

@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}}

tony.kay06:06:34

does seem to work.

tony.kay06:06:26

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.

tony.kay06:06:15

I’m confused as to why you’d need to do that

tony.kay06:06:49

but now the question is: since Om Next supports it, should our forms support as well

mitchelkuijpers06:06:35

In a form we have an default value which I only know when the data is loaded. Because the values are configurable

mitchelkuijpers06:06:13

So I want so set a ident somewhere to fill the default value when it's loaded

mitchelkuijpers06:06:54

And I noticed indeed that it works in Om

tony.kay06:06:09

default value of what?

tony.kay06:06:19

or an entire form

tony.kay06:06:49

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

tony.kay06:06:48

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.

mitchelkuijpers06:06:29

Yes that is how I fixed it now

mitchelkuijpers06:06:47

A subform for a field

mitchelkuijpers06:06:33

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

tony.kay16:06:04

@mitchelkuijpers you do have to put it in place, but I don’t understand why that would lead to ident -> ident -> value

tony.kay16:06:23

nor why that needs to be a subform for a single field

tony.kay16:06:47

Kind of hard to help without code