Many times, people would have been need of local Storage to store persisting data, even after the browser is closed, to be used again, when the sketch is run next time, to remember the state of the sketch the last time it was run , and so on.
I suggest thecreation of a friendly wrapper around the webStorage API of HTML5.
This new feature involves ,
for eg, the implementation can look like:
storeData("a", "apple");
let value = getData("a"); //returns value corresponding to passed name
let values = getData(); //returns everything stored in local Storage
deleteData("a");
deleteData(); //delete all data stored in local Storage
(function names can be set based on further discussions)
Notes:
Benefits:
I request the community to provide their suggestions on this,
Thank you!
There are a number of well-supported js libraries that do this and work well with p5.js, for example:
https://github.com/tsironis/lockr
https://github.com/marcuswestin/store.js
https://github.com/nbubna/store
I think by the time you're using local storage, most users have enough knowledge to understand how to add in an additional library. So I would be hesitant to reinvent the wheel in this case.
I agree. I will close this issue then 馃憤
Most helpful comment
There are a number of well-supported js libraries that do this and work well with p5.js, for example:
https://github.com/tsironis/lockr
https://github.com/marcuswestin/store.js
https://github.com/nbubna/store
I think by the time you're using local storage, most users have enough knowledge to understand how to add in an additional library. So I would be hesitant to reinvent the wheel in this case.