ariel-walley / dnd-app

2 stars 0 forks source link

Socket disconnect message #11

Closed ariel-walley closed 2 years ago

ariel-walley commented 3 years ago

Once a message is sent, the user is disconnected. Would it be more efficient to connect to the server upon initial render and keep that channel open until the window is unmounted? Or is it more efficient as-is, where with each message the window connects and then disconnects?

See Emily's comment: //need to clean up open connection here or everytime you update component it'll open a new connection AND keep old one open and you'll end up with multiple conenctions from each child window