Very cool
It sounds like something you could also achieve with Thomas’s purescript-halogen-store. Though there’ll be more boilerplate to wire it up as it’s meant to scale beyond the single sender/receiver of your wormhole. (though, that said, it appears your project is on Halogen 5, and I’m 80% sure the Halogen Store library isn’t compatible until 6+ anyway).
But if you’re working with a project using Halogen 6.x, then you could use the following two methods to achieve the same thing. i.e.
-
Use updateStore
in the component eval that’s sending the data.
-
In the initialize
action of the component receiving the data, both
a. Use emitSelected
to create an Emitter
, then
b. Halogen.subscribe
to it
And this will let you skip sending the data as input down through each node of the component hierarchy between the two points.