scratchyone / wasm-sockets

A rust WASM-specific websocket library
MIT License
31 stars 3 forks source link

Add close methods #4

Closed vpzomtrrfrt closed 1 year ago

vpzomtrrfrt commented 2 years ago

Allows consumers to close the WebSocket.

I wonder if this should be the default behaviour when dropping the client?

scratchyone commented 1 year ago

Thanks for the PR!

I wonder if this should be the default behaviour when dropping the client?

It probably should, I'll work on a commit for that.

scratchyone commented 1 year ago

I did some more testing, and I think dropping on close might not be ideal since it would cause issues when the EventClient is dropped since users likely expect the callbacks to continue working.

scratchyone commented 1 year ago

Thanks so much for your contribution, it's officially on crates.io as version 0.3.0.