Skip to content

Instantly share code, notes, and snippets.

@cazala
Created July 25, 2018 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cazala/4ead05f889e7d17f960e1a159d61e867 to your computer and use it in GitHub Desktop.
Save cazala/4ead05f889e7d17f960e1a159d61e867 to your computer and use it in GitHub Desktop.
if (elementId === 'register-white') {
if (!playerBlack) {
store.dispatch(initSquares()) // let the first player who registers init the board
}
store.dispatch(registerPlayer(this.id, true))
} else if (elementId === 'register-black') {
if (!playerWhite) {
store.dispatch(initSquares()) // let the first player who registers init the board
}
store.dispatch(registerPlayer(this.id, false))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment