Fork me on GitHub
Mark Wardle21:12:38

Hi all. I am looking at nested routers and have spotted @holyjak ’s which has been very useful. There, I see the use of comp/factory and comp/computed-factory - which has led me down greater understanding of passing computed data/closures vs props as second parameter. But I see that in those examples, not all take advantage of passing computed props and clearly computed factories work fine passing through props if no other parameters are included. Which then leads me to ask the question, why isn’t computed-factory the default - is it simply an optimisation to avoid wrapping?


that's always been my assumption, yeah--`computed-factory` does a little bit of extra work and otherwise directly relies on factory to do everything else:

👍 1

Factories allow react children. We don't use that much in Fulcro, so yes, perhaps the computed factory should be the default, but for legacy reasons the original factory was written to take props and varargs children.

👍 1

so computed-factory has one extra arg: the computed props, then children

Mark Wardle08:12:26

Makes sense - thank you!