Add to array in localForage

I use localForage to store some data on a website to disable it.

I would like to have one key and add to the value / array.

For now, I can only understand how to extract the entire key / value from the repository, and then add and set the entire key / value again. This seems very wasteful and can be problematic when the key / value gets larger.

var obj = ... localforage.getItem('documents', function(err, value) { value.push(obj); localforage.setItem('documents', value); } 

Is there a more efficient way to do this? and how big a key / value would be to notice performance issues.

+6
source share

Source: https://habr.com/ru/post/980252/


All Articles