leptos-use
leptos-use copied to clipboard
Make `use_websocket` not depend on reactive owners
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.
This also goes for other such utilities, to be honest, but I'm interested only in use_websocket for the moment.
Makes sense. When I find some time I'll investigate how to do this best.