Reputation: 1026
I'm developing a front-end project using reactjs. I'm saving the return from my server using localStorage, is there a more efficient & secure method for saving user data in the browser?
localStorage.setItem('user', data);
// Recupere Data
var user = localStorage.getItem('user');
console.log(user);
/* Output */
{_id:1, name: "name here", email: "[email protected]" }
Upvotes: 0
Views: 2237
Reputation: 560
yes use Redux with local storage: Where to write to localStorage in a Redux app?.
use memonization and service workers with caching capability. if your app is progressive
Upvotes: 1