Fork me on GitHub
#fulcro
<
2019-01-17
>
tony.kay00:01:28

@thosmos don’t think either one is going to work. You have two basic choices I think: Write a configurable component whose info sits in state, or a macro…both defsc and sc are macros, so they’d expand before the bits you’re passing arrive.

tony.kay00:01:32

Be glad to chat more over ideas that would

thosmos00:01:14

ok i see, yes I'm forgetting about the macro stage

thosmos00:01:07

I think the configurable component with info in state sounds like it

thosmos00:01:24

I see the destructure of the computed arg would only come from the call to the factory, whereas my pseudo code assumes they'd be available during the macro compilation phase. think I got it

tony.kay01:01:34

@thosmos Are you using forms-state?

tony.kay01:01:44

remember that you can pull the form fields from the defsc’s declaration of them, and with a bit more declared “schema” it would not be too hard to make reusable functions that could be given this and a field and render the rest…with a bit more info, I could imagine a reusable function that could render the entire form as a single call.

tony.kay01:01:23

the query and form-fields are “static”, so they can also be statically analyzed before component mounts…you can walk the query and find forms, etc.