Open blunket opened 5 years ago
You can use an enhancer.
See these examples:
https://github.com/nicolodavis/boardgame.io/blob/master/docs/debugging.md
https://github.com/freeboardgame/FreeBoardGame.org/blob/master/src/games/seabattle/sound.ts
Yes, that should work.
The only downside is that you're depending on an internal implementation detail (for example, if we pull out Redux and use another state management library beneath the hood your code will break). I think we'll eventually want some way to register callbacks with the client that are invoked when certain events happen.
I'd like to be able to access onTurnEnd from the client side, so I can play a chime/bell sound to notify the user of their turn.
Other events on the client would be good too.