jalaj711 / todox-v1

A todo app made on react that stores your todos right in your browser
https://jalaj711.github.io/todox-v1/
MIT License
2 stars 4 forks source link

Employ redux for global state changes rather than `window.***` #7

Open jalaj711 opened 2 years ago

jalaj711 commented 2 years ago

Right now, to make global changes like changing the title or showing the snackbar and even for accessing the database, the app basically attaches a property to the global window object. This is not a good approach as it is unreliable and type support also does not work. Rather than this, it would be much better if we use redux to create and manage a global state and then use actions to make requisite changes during runtime.

tygee713 commented 2 years ago

@jalaj711 I'd like to work on this, but I'm going to scope my PR to just switching over the snackbar functionality which will be a pattern that can be followed by the other use cases.

jalaj711 commented 2 years ago

@tygee713 Sounds good. Please go ahead. Happy Hacking!

jalaj711 commented 2 years ago

With a basic infrastructure already implemented by @tygee713, I think other open source enthusiasts, especially first time contributors can move ahead with implementing redux for other window.** functions, using his PR as an example.

List of functions to be converted: