DEV Community

Discussion on: Write your own WebSocket middleware for React/Redux in 4 Steps

Collapse
 
desirepeeper profile image
Ali Almohsen

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 });

Collapse
 
aduranil profile image
Lina Rudashevski

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