FIX --- optimization
GuRuGuMaWaRu opened this issue · comments
It should rerender only when SIZE state is changes, I should not care about GAMEBOARD or MOUSEDRAG state
Use shouldComponentUpdate or PureComponent to optimize performace --- rerender Gameboard component only when size changes (the only thing that matters for rendering gameboard as a whole), and remake Gameboard cells into separate components and have them rerender when their alive property changes.
Look like replacing object-based gameboard structure with an array-based one didn't help.
If only there was a way to do the whole process differently.
- check for allDead during setInterval action
- change alive-dead class of cells using classList instead of state