leptos-use icon indicating copy to clipboard operation
leptos-use copied to clipboard

Make `use_websocket` not depend on reactive owners

Open mscofield0 opened this issue 1 year ago • 2 comments

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.

mscofield0 avatar Jan 04 '25 16:01 mscofield0

This also goes for other such utilities, to be honest, but I'm interested only in use_websocket for the moment.

mscofield0 avatar Jan 04 '25 16:01 mscofield0

Makes sense. When I find some time I'll investigate how to do this best.

maccesch avatar Jan 04 '25 20:01 maccesch