I’m trying to decide how to store data in localStorage. If I have data that is being updated every time the user interacts with the app that is stored in localStorage, then I have to do the save to localStorage after each data item is changed (assuming a web app). EG, there is no way to capture the app close so you can dump important memory variables to localStorage, you must save after each change.
First, I’m using JSONstringify to turn the data objects into strings for storage into localStorage.
I could save a large chunk of data, of which the one data point that is changed would be a part of it. Or I could setup a bunch of small chunks and update one of the small chunks. I’m leaning toward the large chunk, as that is how the data is currently stored in memory of the app - eg, it could be one - to - one localStorage to internal memory.
Anyone have any input on chunk sizing in localStorage?