I am trying to use purescript-thermite to build an application using websockets. The idea is that the application connects to some server using websockets and live-updates the HTML page. However, I cannot find a way how to wire it into the thermite workflow.
I have a spec
that is made up of render
and performAction
. The render
has access to the dispatch
function. However, I need to start the websockets before rendering the element (I could probably put it e.g. into main
), but upon arrival of a message I need to ideally dispatch
an event to the component from the outside. What is the best way to do that?