desko27 / smashtierlist

🎮⚡️ Popular tier lists for Super Smash Bros. series
https://smashtierlist.net
43 stars 6 forks source link

Replace redux with pure-store. #1

Closed gunn closed 6 years ago

gunn commented 6 years ago

Eliminates 19 files, 800 lines of code, and several dependencies while making the logic more straightforward.

desko27 commented 6 years ago

Hey, thank you so much for your PR!

First things first. Let me tell you that I find your package to be really useful, you basically made a global version of React Component's state and it's neat and totally awesome 👏🏻👏🏻👏🏻 so you got my star!

By the other hand, there're a few non-obvious reasons why I used Redux here, which I'll explain later (because I know it wasn't strictly necessary for the current working version of the project).

About code reduction, I see that those 800 lines come from:

Honestly, I would merge if I hadn't coded all that isolated logic with actions and tests because a very specific reason: v2. It will take time, but I'm working on the concept for the next version of this project which is going to handle completely new features which will require:

So, if the current concept were to be left like it is, this PR would be a perfect match, but Redux here is just a foundation which serves as a preparation for the next version, in which I'm going to take advantage of the already coded (and tested) actions, reducers and selectors, in order to provide users with robust reactions to UI interaction.

Finally, I understand that ultimately there's nothing preventing me to use another approach anyway, even for all those new features, but as a matter of personal taste I also really like the logic isolation/splitting/testing/actions approach which Redux offers, and I would not feel comfortable by writing state changes and API calls directly inside the React Components.

But I really appreciate that you showed pure-store here! I insist that it would be fantastic for this project if I were not moving to something much more interactive for the next version in which I have maximum interest in logic isolation and testing. Other than that, I have something in mind for which it may be a perfect fit 👍🏻