-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
posts/day14/ #9
Comments
Why did u call Local Storage as Low grade?. Its a good and the simplest way many times. |
It's not that I call localStorage as "low grade" specifically, I meant it as low grade alternative to state management (kind of). Having some data that doesn't update frequently outside of your component tree is something that can be done with localStorage (similar to having a global state), but one shouldn't simply shift to it because you cannot make other components re-render if one component changes the value in localStorage. This is other benefit of something like Redux, you can make components re-render or "subscribe" to changes in global state. |
What I feel you are missing about LocalStorage is, that in siormple cases, they can be used a "database". All the redux state variables and all are good till the website is open. Once the site is closed, there needs to be a place where data is stored. LocalStorage is the only option then. Of course you can have a database, which is the right way. But LocalStorage solves problems in simple way! |
Yep, I agree with you. There are other uses of localStorage too, some of which I have mentioned. It solves some problems on some scale, and not a complete replacement for them, hence the reason you have put database in inverted commas. |
Day-14, LocalStorage need to kept in check
https://sahil-shubham.in/posts/day14/
The text was updated successfully, but these errors were encountered: