Hacker News new | ask | show | jobs
by efdee 3420 days ago
I really enjoyed playing this clone. Well done!

That being said, I took a look at the code and the way Redux is being used feels kind of weird to me - pretty much a separate reducer for every kind of action.

2 comments

Agree. Besides that most reducers only merges in variables from an action to the global state. I guess this could be done much simpler.

Example: https://github.com/chvin/react-tetris/blob/master/src/reduce...

The game looks great, but the code is overly over engineered. I've written a bunch of tetris clones in my time and it never felt this complex.
I think primary focus of this project was to showcase proper Redux implementation. There certainly are much easier ways to accomplish Tetris but that is not what they were shooting for.
Only connecting the root component, fetching the entire state, and passing down all those props manually isn't proper. You shouldn't pass props that can be grabbed directly from the store IMO.