After working with imba for a little over 14ish hours now, I’m at a point where I feel mostly comfortable. Though, since I’ve started, I’ve had a burning question . . .
What is the best way to pass state to children that are far down the tree? ‘Lifting the state up’ or hard-wiring the path makes the GUI inflexible and tightly-coupled; also lifting the state up adds a lot of noise. To solve this problem in other frameworks, I’ve used dependency injection in Flutter (using dependency injection over their build context), and Svelte had a “Context” API. These allowed me to essentially pass state down the tree directly to whatever asked for that specific state. It removes the noise and the tight-coupling.
The closest things I’ve thought of for Imba without reinventing the wheel was using global state or just falling back to tightly coupling the state-path to the components. While global state made a lot of sense at first, it ended up not being practical for scenarios where sub-tags that used the same name but were looking for unique data would be in conflict. Otherwise, I was running into trouble understanding the component data-flow and update/rendering cycles that prevented me from making my own context API.
Any ideas or suggestions? Thanks!!