Friday 2 June 2017

Redux + socket.io in the server - Does business logic belong in event listeners or action creators?

I'm implementing an online multiplayer game which will receive connections from clients through socket.io.

I'm not sure where to handle events in the server - either in the socket event listeners themselves, or if they should defer this logic to the action creators.

Take into account that in many of the cases, receiving an event from a client socket will trigger an .emit or .broadcast from the server side, so I need to have access to socket and io inside whatever function handles this.



via Thiatt

No comments:

Post a Comment