Conversation started Mar 23, 2016 at 20:24.
Mar 23, 2016 20:24
How will Redux and Websockets interact together? Is there something that will need to be the "glue" between the two or can they interact directly?
@PinCrash @SirPython proposed something earlier
I don't have a full idea, I would suggest just piping out messages via store dispatches from the websocket
But the only downside there is that you can't trigger actions from the reducer, so you'd have to have the dispatcher aware of all possible messages (that could be a good or bad thing)
Or you MIGHT be able to use middleware to solve that issue, I don't know.
Actually, yeah, middleware is probably right
you'd dispatch something like this.....
store.dispatch({
  type: MESSAGE_RECEIVED,
  payload: {},
  ...
})
And you'd catch it with a middleware like this...
const middleware = store => next => action => {
  if (action.type === MESSAGE_RECEIVED) {
    // transform the message somehow..
   return next(action)
  }
}
sorry, brain dump :-)
> Could we make the game server handle this and let the client only display it in response? Imagine a server-side logic like `while PlayerA is not ready OR PlayerB is not ready, push information message every X seconds" or something along those lines. Thoughts?
@DanPantry maybe put those brain dumps on the issue?
 
Conversation ended Mar 23, 2016 at 20:33.