valtio-define 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{subscribe as e}from"valtio";import{get as t,set as n}from"@hairy/utils";import{destr as r}from"destr";import{generateStructureId as i}from"structure-id";function a(){return a=>{if(!a.options.persist)return;let o=typeof a.options.persist==`boolean`?{}:a.options.persist;o.key=o.key||i(a.store.$state);let s=o.storage||(typeof localStorage<`u`?localStorage:void 0),c=s?.getItem(o.key),l=!1;c instanceof Promise?c.then(u):u(c);function u(e){Object.assign(a.store.$state,r(e)),l=!0}e(a.store.$state,()=>{if(!l)return;let e=o.paths||Object.keys(a.store.$state),r={};for(let i of e)n(r,i,t(a.store.$state,i));let i=JSON.stringify(r);s?.setItem(o.key,i)})}}export{a as t};
1
+ import{subscribe as e}from"valtio";import{get as t,set as n}from"@hairy/utils";import{destr as r}from"destr";import{generateStructureId as i}from"structure-id";function a(){return a=>{if(!a.options.persist)return;let o=typeof a.options.persist==`boolean`?{}:a.options.persist;o.key=o.key||i(a.store.$state);let s=o.storage||(typeof localStorage<`u`?localStorage:void 0),c=s?.getItem(o.key),l=!1;c instanceof Promise?c.then(u):u(c);function u(e){Object.assign(a.store.$state,r(e)),l=!0}e(a.store.$state,()=>{if(!l)return;let e=o.paths||Object.keys(a.store.$state),r={};for(let i of e)n(r,i,t(a.store.$state,i));let i=JSON.stringify(r);s?.setItem(o.key,i)})}}var o=a;export{o as t};
@@ -1,3 +1,3 @@
1
1
  import "../index-CXmAkQQL.mjs";
2
- import { i as persistent, n as PersistentOptions, r as Storage, t as DeepKeys } from "../index-BvOmxIpj.mjs";
3
- export { DeepKeys, PersistentOptions, Storage, persistent };
2
+ import { n as PersistentOptions, r as Storage, t as DeepKeys } from "../index-BvOmxIpj.mjs";
3
+ export { DeepKeys, PersistentOptions, Storage };
@@ -1 +1 @@
1
- import{t as e}from"../persistent-D75wnuGb.mjs";export{e as persistent};
1
+ import"../persistent-Cp0WGzx8.mjs";export{};
@@ -1,3 +1,3 @@
1
1
  import "../../index-CXmAkQQL.mjs";
2
2
  import { i as persistent, n as PersistentOptions, r as Storage, t as DeepKeys } from "../../index-BvOmxIpj.mjs";
3
- export { DeepKeys, PersistentOptions, Storage, persistent };
3
+ export { DeepKeys, PersistentOptions, Storage, persistent as default };
@@ -1 +1 @@
1
- import{t as e}from"../../persistent-D75wnuGb.mjs";export{e as persistent};
1
+ import{t as e}from"../../persistent-Cp0WGzx8.mjs";export{e as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valtio-define",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "description": "⚡quickly create a fully functional and robust Valtio factory",
6
6
  "author": "Hairyf <wwu710632@gmail.com>",
7
7
  "license": "MIT",