If you don't have a WebSocket
being initialized in some sort of root component, and instead you spawn them off in some effect, then you have no way of controlling the socket's lifetime. It would be best for use_websocket
to have an additional Arc
-like version of itself where the lifetime is controlled by reference counting, and not by the lifetime of its reactive owner.