react-redux-socketio-chat
react-redux-socketio-chat copied to clipboard
Why do you send the same message twice?
You use socket to send the message and use http(post) to send it again. I think socket is enough.
I use socket to send it to other clients and http post to send it to the database. What do you mean?
I mean that it is a waste to transfer data twice after login. You can catch the data by socket and then save it into DB.
Wow I never though about that!
actually you should not broadcast the message before saving it to the database :P