pinia-plugin-persist-uni
Advanced tools
Comparing version 0.0.4 to 1.0.1
@@ -8,5 +8,5 @@ const updateStorage = (strategy, store) => { | ||
}, {}); | ||
uni.setStorageSync(storeKey, JSON.stringify(partialState)); | ||
uni.setStorage({ key: storeKey, data: JSON.stringify(partialState) }); | ||
} else { | ||
uni.setStorageSync(storeKey, JSON.stringify(store.$state)); | ||
uni.setStorage({ key: storeKey, data: JSON.stringify(store.$state) }); | ||
} | ||
@@ -13,0 +13,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
(function(t,i){typeof exports=="object"&&typeof module!="undefined"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(t=typeof globalThis!="undefined"?globalThis:t||self,i(t.piniaPersist={}))})(this,function(t){"use strict";const i=(s,e)=>{const n=s.key||e.$id;if(s.paths){const d=s.paths.reduce((a,u)=>(a[u]=e.$state[u],a),{});uni.setStorageSync(n,JSON.stringify(d))}else uni.setStorageSync(n,JSON.stringify(e.$state))};var o=({options:s,store:e})=>{var n,d,a,u;if((n=s.persist)!=null&&n.enabled){const p=[{key:e.$id}],f=(a=(d=s.persist)==null?void 0:d.strategies)!=null&&a.length?(u=s.persist)==null?void 0:u.strategies:p;f.forEach(r=>{const S=r.key||e.$id,c=uni.getStorageSync(S);c&&(e.$patch(JSON.parse(c)),i(r,e))}),e.$subscribe(()=>{f.forEach(r=>{i(r,e)})})}};t.default=o,t.updateStorage=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
(function(t,i){typeof exports=="object"&&typeof module!="undefined"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(t=typeof globalThis!="undefined"?globalThis:t||self,i(t.piniaPersist={}))})(this,function(t){"use strict";const i=(s,e)=>{const a=s.key||e.$id;if(s.paths){const u=s.paths.reduce((n,d)=>(n[d]=e.$state[d],n),{});uni.setStorage({key:a,data:JSON.stringify(u)})}else uni.setStorage({key:a,data:JSON.stringify(e.$state)})};var c=({options:s,store:e})=>{var a,u,n,d;if((a=s.persist)!=null&&a.enabled){const p=[{key:e.$id}],f=(n=(u=s.persist)==null?void 0:u.strategies)!=null&&n.length?(d=s.persist)==null?void 0:d.strategies:p;f.forEach(r=>{const l=r.key||e.$id,o=uni.getStorageSync(l);o&&(e.$patch(JSON.parse(o)),i(r,e))}),e.$subscribe(()=>{f.forEach(r=>{i(r,e)})})}};t.default=c,t.updateStorage=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
{ | ||
"name": "pinia-plugin-persist-uni", | ||
"version": "0.0.4", | ||
"version": "1.0.1", | ||
"repository": { | ||
@@ -13,3 +13,4 @@ "type": "git", | ||
"docs:build": "vitepress build docs", | ||
"push": "git add . && git commit -m 'update' && git push" | ||
"push": "git add . && git commit -m 'update' && git push", | ||
"npm": "npm version patch && git push" | ||
}, | ||
@@ -16,0 +17,0 @@ "files": [ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5830
1