You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{local}from'proxy-web-storage';local.on('test',function(newVal,oldVal){console.log('test',newVal,oldVal);});local.on('test.a',function(newVal,oldVal){console.log('test.a',newVal,oldVal);});local.test={};// test {} undefinedlocal.test.a=1;// test.a 1 undefined
Expired
set expires for items.
import{local}from'proxy-web-storage';local.test='hello proxy-web-storage';local.setExpires('test',Date.now()+10000);// after 10'slocal.test// undefined
The text was updated successfully, but these errors were encountered:
项目地址: https://github.com/KID-joker/proxy-web-storage
文章地址: https://juejin.cn/post/7144142689594769415
项目介绍: 借助proxy,扩展了web storage的功能,使用起来,更加方便快捷,也更加强大。主要功能为保持值类型不变,可直接操控Object、Array,支持监听数据变化和设置过期时间。
Features
Base
Get what you set and change array and object directly.
Subscribe
listen for changes.
Expired
set expires for items.
The text was updated successfully, but these errors were encountered: