Another way is (or will be) kv storage. It's the first built in module for the web.
below code copied from article:
import{storage}from'std:kv-storage';constmain=async()=>{constoldPreferences=awaitstorage.get('preferences');document.querySelector('form').addEventListener('submit',async()=>{constnewPreferences=Object.assign({},oldPreferences,{// Updated preferences go here...});awaitstorage.set('preferences',newPreferences);});};
It uses indexedDb under the hood, but provides a convenient API similar to localStorage. With the main difference that it is asynchronous and therefore doesn't block the main thread.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Another way is (or will be) kv storage. It's the first built in module for the web.
below code copied from article:
It uses indexedDb under the hood, but provides a convenient API similar to localStorage. With the main difference that it is asynchronous and therefore doesn't block the main thread.