1.1.1 • Published 1 year ago

hc_localstorage_plus v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

How

npm i hc_localstorage_plus

What

避免了繁琐的手动存储操作,并提供了更高的数据访问和修改安全性。 这使得代码更加简洁易读,易于维护和扩展。

why?

Former: JSON.parse(localStorage.getItem(${key})) || {};

optimization: myLocalStorage.${key}

Example

const key = "myObject";
const initialData = {
    initData: "newData",
};

const myLocalStorage = new ProxiedLocalStorage(key, initialData);
// set it = localStorage.setItem(${key}, ${value})
myLocalStorage.initData = "change";
// get it = localStorage.getItem(${key}, ${value})
console.log(myLocalStorage.initData)

Effect

effct

1.1.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago