elysiajs / eden

Fully type-safe Elysia client
MIT License
173 stars 41 forks source link

ws: Add `autoReconnect` option? #107

Open crishoj opened 5 months ago

crishoj commented 5 months ago

After migrating from VueUse useWebSocket, I realized that EdenWS doesn't have an auto-reconnect option.

Would you welcome a PR adding an autoReconnect option?

dandeduck commented 5 months ago

Makes sense, if you ask me, ws should accept the same options as the underlying ws implementation.

crishoj commented 5 months ago

The auto-reconnect is not actually present in the underlying (bare) WebSocket, but since handling disconnects (by reconnecting) is a fairly common need, I think it could be warranted to add in Eden.

dandeduck commented 4 months ago

ahh right, I think it would be welcome if you created a PR with it (But I'm not the maintainer or anything, I'll be happy to give you a review, but I cannot merge it of course)