Hi...
I am a beginner Vue guy, sorry I invaded to this post.
My question is kinda general tho...
For example, if one of our component holds the state of username and we accidentally forgot to include that component in certain pages that requires username state. Will the state of username actually gone when we visit the page with that missing component? I've never build a huge application with moving states from one component to others. I just store the state inside localStorage and access it whenever I want but sometimes it bothers me that user can manipulate the state by injecting their own JS script inside the console.
The question is, what is the best approach if I want to keep the state globally while still able to access/manipulate it easily?
If we're talking about Vue specifically I'm afraid I don't really know it well enough to answer. I can link you to their documentation on state management though.
I just store the state inside localStorage and access it whenever I want but sometimes it bothers me that user can manipulate the state by injecting their own JS script inside the console
Just to be clear, this is the case regardless of if you're using localStorage or a state management lib. Anything on the client should be considered accessible to the user.
Hi...
I am a beginner Vue guy, sorry I invaded to this post.
My question is kinda general tho...
For example, if one of our component holds the state of
username
and we accidentally forgot to include that component in certain pages that requiresusername
state. Will the state ofusername
actually gone when we visit the page with that missing component? I've never build a huge application with moving states from one component to others. I just store the state inside localStorage and access it whenever I want but sometimes it bothers me that user can manipulate the state by injecting their own JS script inside the console.The question is, what is the best approach if I want to keep the state globally while still able to access/manipulate it easily?
Thanks.
Hi, no need to apologise the more the merrier π
If we're talking about Vue specifically I'm afraid I don't really know it well enough to answer. I can link you to their documentation on state management though.
State Management β Vue.js
Thank you βΊοΈ
Just to be clear, this is the case regardless of if you're using
localStorage
or a state management lib. Anything on the client should be considered accessible to the user.I've been bugging myself for quite some time about this. Now I can stop concerning too much about keeping state in
localStorage
.Thank you. π
Yes, don't worry about it unless it's sensitive information - that should never be stored on the client.