mdfw
3 years agoGenius
Community: Variable scoping in a quilt
Given a quilt that has:
<component id="poodle-moth"/>
<component id="dumbo-octopus"/>
<component id="batfish"/>
Is there a way to set a variable in component "poodle-moth" that then can be read in component "dumbo-octopus" or "batfish"? Assign is scoped to the component or endpoint it is defined in. Local is even more tightly scoped. Is there a "Quilt" or "Global" assignment that can cross component boundaries?
Reason: I want to do a lookup in poodle-moth, display parts of what it found in dumbo-octopus and batfish without having to do the lookup again.
Having written all this, I guess one way to do this would be to wrap these three components in another component then pass them in...would that work?
Having written all this, I guess one way to do this would be to wrap these three components in another component then pass them in...would that work?
This would have been the way we suggested solving this problem. Alternatively, you could consider using the app cache or user cache (see more), but we would lean towards the composition approach you suggested.