Fork me on GitHub
#fulcro
<
2022-03-25
>
Karol Wójcik08:03:58

I'm taking a form with it's subform via (let [fields (fs/dirty-fields props false)] . This is cool, but how can convert the normalized fields to denormalized (joined) fields?

tony.kay16:03:45

subforms in the form-state system are always components. Dirty/invalid is done at each subform component, so the props are already relative.

tony.kay16:03:20

At the “top level” you should only care about the field that are explicitly there, or that something is wrong…the specifics are handled lower down in the subform components

tony.kay16:03:06

Otherwise you’d have a huge mess of path info to deal with. You’re certainly welcome to hand-write form handling library yourself and switch it around to something you prefer 😄

Karol Wójcik09:03:47

I'm sorry. I feel like I haven't expressed myself sufficiently. I use dirty fields in the transact!'s mutation (as shown in the docstring of dirty-fields). However, I would like the dirty-fields to not be normalized, but rather denormalized when I send them over the wire.

tony.kay16:03:00

Not sure why you'd want to do that... You can always pass whatever you want in a mutation... So pass the demonstrated props from the ui