If you want to use websockets with redux and don't like dependencies, it's not too hard to write your own middleware as long as you understand some...
For further actions, you may consider blocking this person and/or reporting abuse
Love it, thanks a lot for the excellent implementation! Quick question though, what's the point of this action which isn't called anywhere and isn't handled in the middleware nor reducer:
export const wsConnecting = host => ({ type: 'WS_CONNECTING', host });
Thanks for pointing this out, I do indeed have this defined but did not use it in my code. The original intention was to console.log when the websocket was in a connecting state but not yet connected, simply for logging and debugging purposes. I ended up not using it
hi, Thanks for this wonderful library. when I trigger
WS_CONNECT
automatically 'onClose' websocket handler calling. therefor before connecting with server it will automatically triggering in onCloseWS_DISCONNECTED
Hi Lina, loved your post.
Quick doubt - the native JS websocket connection closes after 60 seconds of inactivity. I read almost everywhere to implement a ping-pong based fixed interval communication between clients and server to keep it alive. Do you agree or suggest something else around this problem?
Even sophisticated wrapper like socket.io have same problem if I choose the websocket mode of transportation with them instead of polling.
Awesome breakdown!
thanks
Great article, explains how to write middleware in a very straight forward manner.
Hi, could you please tell me which version of react and react-redux you have used for this example?
Thank you.