Last active
March 1, 2018 16:01
-
-
Save goldensunliu/d72244e8d4672f80d37eb3174859efc9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game extends Compoent { | |
... | |
getSelectedCell() { | |
const { board } = this.state; | |
const selected = board.get('selected'); | |
return selected && board.get('puzzle').getIn([selected.x, selected.y]); | |
} | |
selectCell = (x, y) => { | |
let { board } = this.state | |
board = board.set('selected', { x, y }) | |
this.setState({ selected: { x, y }, board}) | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment