untangled

NEW CHANNEL: #fulcro
tony.kay 2017-06-14T06:20:20.294062Z

@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.kay 2017-06-14T06:20:34.296066Z

does seem to work.

tony.kay 2017-06-14T06:22:26.311679Z

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.kay 2017-06-14T06:23:15.318361Z

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

tony.kay 2017-06-14T06:23:49.323154Z

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

mitchelkuijpers 2017-06-14T06:24:35.329620Z

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

mitchelkuijpers 2017-06-14T06:25:13.334851Z

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

mitchelkuijpers 2017-06-14T06:25:54.340839Z

And I noticed indeed that it works in Om

tony.kay 2017-06-14T06:26:09.343006Z

default value of what?

tony.kay 2017-06-14T06:26:13.343430Z

a field?

tony.kay 2017-06-14T06:26:19.344406Z

or an entire form

tony.kay 2017-06-14T06:27:49.357282Z

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.kay 2017-06-14T06:29:48.374033Z

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.

mitchelkuijpers 2017-06-14T06:37:29.442877Z

Yes that is how I fixed it now

mitchelkuijpers 2017-06-14T06:37:47.445514Z

A subform for a field

mitchelkuijpers 2017-06-14T06:43:33.496765Z

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.kay 2017-06-14T16:06:04.977587Z

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

tony.kay 2017-06-14T16:07:23.008845Z

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

tony.kay 2017-06-14T16:07:47.018380Z

Kind of hard to help without code