What is the benefit of setting the parent property...
# general
w
What is the benefit of setting the parent property on a resource? The resource graph is more visually pleasing, but is there any other part I'm missing?
l
Opts are inherited from parents. This is mostly relevant to providers.
👍 1
s
It's mostly relevant in Components. I think @little-cartoon-10569 was specifically referring to the fact that setting a parent will ensure that the child has the same provider as the parent. I wouldn't bother with setting parents unless you're using Components.
l
Yes, or if you're using objects that are equivalent to ComponentResources. We have a weird logging decorator object that creates a few resources as children of a selection of passed-in resources, so we use
parent
to show the relationship there.