🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

valtio

Package Overview
Dependencies
Maintainers
2
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

valtio - npm Package Compare versions

Comparing version

to
1.13.0

2

esm/vanilla/utils.d.ts

@@ -7,4 +7,4 @@ export { subscribeKey } from './utils/subscribeKey';

export { proxyWithComputed_DEPRECATED as proxyWithComputed } from './utils/proxyWithComputed';
export { proxyWithHistory } from './utils/proxyWithHistory';
export { proxyWithHistory_DEPRECATED as proxyWithHistory } from './utils/proxyWithHistory';
export { proxySet } from './utils/proxySet';
export { proxyMap } from './utils/proxyMap';

@@ -211,3 +211,8 @@ import { subscribe, snapshot, proxy, ref, unstable_buildProxyFunction } from 'valtio/vanilla';

};
function proxyWithHistory(initialValue, skipSubscribe = false) {
function proxyWithHistory_DEPRECATED(initialValue, skipSubscribe = false) {
if (process.env.NODE_ENV !== "production") {
console.warn(
'proxyWithHistory is deprecated. Please use the "valtio-history" package; refer to the docs'
);
}
const proxyObject = proxy({

@@ -399,2 +404,2 @@ value: initialValue,

export { addComputed_DEPRECATED as addComputed, devtools, proxyMap, proxySet, proxyWithComputed_DEPRECATED as proxyWithComputed, proxyWithHistory, subscribeKey, watch };
export { addComputed_DEPRECATED as addComputed, devtools, proxyMap, proxySet, proxyWithComputed_DEPRECATED as proxyWithComputed, proxyWithHistory_DEPRECATED as proxyWithHistory, subscribeKey, watch };

@@ -26,4 +26,7 @@ import type { INTERNAL_Snapshot as Snapshot } from 'valtio/vanilla';

* })
*
* @deprecated Please use the `valtio-history` package. eg.
* import { proxyWithHistory } from 'valtio-history'
*/
export declare function proxyWithHistory<V>(initialValue: V, skipSubscribe?: boolean): {
export declare function proxyWithHistory_DEPRECATED<V>(initialValue: V, skipSubscribe?: boolean): {
value: V;

@@ -30,0 +33,0 @@ history: {

{
"name": "valtio",
"private": false,
"version": "1.12.1",
"version": "1.13.0",
"description": "💊 Valtio makes proxy-state simple for React and Vanilla",

@@ -6,0 +6,0 @@ "main": "./index.js",

@@ -317,3 +317,3 @@ <img src="logo.svg" alt="valtio">

```js
import { proxyWithHistory } from 'valtio/utils'
import { proxyWithHistory } from 'valtio-history'

@@ -320,0 +320,0 @@ const state = proxyWithHistory({ count: 0 })

System.register(['valtio/vanilla', 'valtio/react'], (function (exports) {
'use strict';
var _starExcludes = {
__proto__: null,
default: 1

@@ -8,3 +9,3 @@ };

setters: [function (module) {
var setter = {};
var setter = { __proto__: null };
for (var name in module) {

@@ -15,3 +16,3 @@ if (!_starExcludes[name]) setter[name] = module[name];

}, function (module) {
var setter = {};
var setter = { __proto__: null };
for (var name in module) {

@@ -18,0 +19,0 @@ if (!_starExcludes[name]) setter[name] = module[name];

@@ -1,1 +0,1 @@

System.register(["valtio/vanilla","valtio/react"],function(e){"use strict";var f={default:1};return{setters:[function(r){var i={};for(var t in r)f[t]||(i[t]=r[t]);e(i)},function(r){var i={};for(var t in r)f[t]||(i[t]=r[t]);e(i)}],execute:function(){}}});
System.register(["valtio/vanilla","valtio/react"],function(_){"use strict";var n={__proto__:null,default:1};return{setters:[function(r){var i={__proto__:null};for(var t in r)n[t]||(i[t]=r[t]);_(i)},function(r){var i={__proto__:null};for(var t in r)n[t]||(i[t]=r[t]);_(i)}],execute:function(){}}});

@@ -51,3 +51,3 @@ System.register(['@babel/helper-module-imports', '@babel/types', 'babel-plugin-macros'], (function (exports) {

};
var macro$1 = exports('default', createMacro(macro, { configName: "valtio" }));
var macro$1 = exports("default", createMacro(macro, { configName: "valtio" }));

@@ -54,0 +54,0 @@ })

@@ -16,3 +16,3 @@ System.register(['@babel/helper-module-imports', '@babel/types', 'aslemammad-vite-plugin-macro', 'babel-plugin-macros'], (function (exports) {

exports('provideValtioMacro', provideValtioMacro);
exports("provideValtioMacro", provideValtioMacro);

@@ -24,3 +24,3 @@ const { defineMacro, defineMacroProvider, createMacroPlugin } = (

);
const valtioMacro = exports('valtioMacro', defineMacro(`useProxy`).withSignature(`<T extends object>(proxyObject: T): void`).withHandler((ctx) => {
const valtioMacro = exports("valtioMacro", defineMacro(`useProxy`).withSignature(`<T extends object>(proxyObject: T): void`).withHandler((ctx) => {
var _a, _b, _c, _d;

@@ -70,3 +70,3 @@ const { path, args } = ctx;

}
const macroPlugin = exports('default', createMacroPlugin({}).use(provideValtioMacro()));
const macroPlugin = exports("default", createMacroPlugin({}).use(provideValtioMacro()));

@@ -73,0 +73,0 @@ })

@@ -24,3 +24,3 @@ System.register(['react', 'proxy-compare', 'use-sync-external-store/shim', 'valtio/vanilla'], (function (exports) {

exports('useSnapshot', useSnapshot);
exports("useSnapshot", useSnapshot);

@@ -27,0 +27,0 @@ const { use } = ReactExports;

@@ -12,3 +12,3 @@ System.register(['react', 'valtio/react'], (function (exports) {

exports('useProxy', useProxy);
exports("useProxy", useProxy);

@@ -15,0 +15,0 @@ const DUMMY_SYMBOL = Symbol();

System.register(['valtio/vanilla/utils', 'valtio/react/utils'], (function (exports) {
'use strict';
var _starExcludes = {
__proto__: null,
default: 1

@@ -8,3 +9,3 @@ };

setters: [function (module) {
var setter = {};
var setter = { __proto__: null };
for (var name in module) {

@@ -15,3 +16,3 @@ if (!_starExcludes[name]) setter[name] = module[name];

}, function (module) {
var setter = {};
var setter = { __proto__: null };
for (var name in module) {

@@ -18,0 +19,0 @@ if (!_starExcludes[name]) setter[name] = module[name];

@@ -1,1 +0,1 @@

System.register(["valtio/vanilla/utils","valtio/react/utils"],function(s){"use strict";var e={default:1};return{setters:[function(r){var i={};for(var t in r)e[t]||(i[t]=r[t]);s(i)},function(r){var i={};for(var t in r)e[t]||(i[t]=r[t]);s(i)}],execute:function(){}}});
System.register(["valtio/vanilla/utils","valtio/react/utils"],function(_){"use strict";var l={__proto__:null,default:1};return{setters:[function(r){var i={__proto__:null};for(var t in r)l[t]||(i[t]=r[t]);_(i)},function(r){var i={__proto__:null};for(var t in r)l[t]||(i[t]=r[t]);_(i)}],execute:function(){}}});

@@ -286,3 +286,3 @@ System.register(['proxy-compare'], (function (exports) {

}
const unstable_buildProxyFunction = exports('unstable_buildProxyFunction', buildProxyFunction);
const unstable_buildProxyFunction = exports("unstable_buildProxyFunction", buildProxyFunction);

@@ -289,0 +289,0 @@ })

@@ -23,3 +23,3 @@ System.register(['valtio/vanilla', 'derive-valtio'], (function (exports) {

proxyWithComputed: proxyWithComputed_DEPRECATED,
proxyWithHistory: proxyWithHistory,
proxyWithHistory: proxyWithHistory_DEPRECATED,
subscribeKey: subscribeKey,

@@ -235,3 +235,8 @@ watch: watch

};
function proxyWithHistory(initialValue, skipSubscribe = false) {
function proxyWithHistory_DEPRECATED(initialValue, skipSubscribe = false) {
{
console.warn(
'proxyWithHistory is deprecated. Please use the "valtio-history" package; refer to the docs'
);
}
const proxyObject = proxy({

@@ -238,0 +243,0 @@ value: initialValue,

@@ -1,2 +0,2 @@

System.register(["valtio/vanilla","derive-valtio"],function(m){"use strict";var b,p,y,E,w,j;return{setters:[function(c){b=c.subscribe,p=c.snapshot,y=c.proxy,E=c.ref,w=c.unstable_buildProxyFunction},function(c){j=c.derive,m({derive:c.derive,underive:c.underive,unstable_deriveSubscriptions:c.unstable_deriveSubscriptions})}],execute:function(){m({addComputed:M,devtools:D,proxyMap:z,proxySet:R,proxyWithComputed:I,proxyWithHistory:H,subscribeKey:c,watch:C});function c(a,s,t,e){let r=a[s];return b(a,()=>{const o=a[s];Object.is(r,o)||t(r=o)},e)}let v;function C(a,s){let t=!0;const e=new Set,r=new Map,o=()=>{t&&(t=!1,e.forEach(i=>i()),e.clear(),r.forEach(i=>i()),r.clear())},l=async()=>{if(!t)return;e.forEach(d=>d()),e.clear();const i=new Set,O=v;v=e;try{const d=a(u=>{if(i.add(u),t&&!r.has(u)){const h=b(u,l,s==null?void 0:s.sync);r.set(u,h)}return u}),n=d&&d instanceof Promise?await d:d;n&&(t?e.add(n):o())}finally{v=O}r.forEach((d,n)=>{i.has(n)||(r.delete(n),d())})};return v&&v.add(o),l(),o}const x=Symbol();function D(a,s){typeof s=="string"&&(console.warn("string name option is deprecated, use { name }. https://github.com/pmndrs/valtio/pull/400"),s={name:s});const{enabled:t,name:e="",...r}=s||{};let o;try{o=(t!=null?t:!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!o)return;let l=!1;const i=o.connect({name:e,...r}),O=b(a,n=>{const u=n.filter(([h,f])=>f[0]!==x).map(([h,f])=>`${h}:${f.map(String).join(".")}`).join(", ");if(u)if(l)l=!1;else{const h=Object.assign({},p(a));delete h[x],i.send({type:u,updatedAt:new Date().toLocaleString()},h)}}),d=i.subscribe(n=>{var u,h,f,_,P,A;if(n.type==="ACTION"&&n.payload)try{Object.assign(a,JSON.parse(n.payload))}catch(S){console.error(`please dispatch a serializable value that JSON.parse() and proxy() support
`,S)}if(n.type==="DISPATCH"&&n.state){if(((u=n.payload)==null?void 0:u.type)==="JUMP_TO_ACTION"||((h=n.payload)==null?void 0:h.type)==="JUMP_TO_STATE"){l=!0;const S=JSON.parse(n.state);Object.assign(a,S)}a[x]=n}else if(n.type==="DISPATCH"&&((f=n.payload)==null?void 0:f.type)==="COMMIT")i.init(p(a));else if(n.type==="DISPATCH"&&((_=n.payload)==null?void 0:_.type)==="IMPORT_STATE"){const S=(P=n.payload.nextLiftedState)==null?void 0:P.actionsById,U=((A=n.payload.nextLiftedState)==null?void 0:A.computedStates)||[];l=!0,U.forEach(({state:k},N)=>{const L=S[N]||"No action found";Object.assign(a,k),N===0?i.init(p(a)):i.send(L,p(a))})}});return i.init(p(a)),()=>{O(),d==null||d()}}function M(a,s,t=a){const e={};return Object.keys(s).forEach(r=>{e[r]=o=>s[r](o(a))}),j(e,{proxy:t})}function I(a,s){Object.keys(s).forEach(e=>{if(Object.getOwnPropertyDescriptor(a,e))throw new Error("object property already defined");const r=s[e],{get:o,set:l}=typeof r=="function"?{get:r}:r,i={};i.get=()=>o(p(t)),l&&(i.set=O=>l(t,O)),Object.defineProperty(a,e,i)});const t=y(a);return t}const J=a=>typeof a=="object"&&a!==null;let g;const T=a=>{if(g||(g=w()[2]),!J(a)||g.has(a))return a;const s=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return Reflect.ownKeys(a).forEach(t=>{s[t]=T(a[t])}),s};function H(a,s=!1){const t=y({value:a,history:E({wip:void 0,snapshots:[],index:-1}),clone:T,canUndo:()=>t.history.index>0,undo:()=>{t.canUndo()&&(t.value=t.history.wip=t.clone(t.history.snapshots[--t.history.index]))},canRedo:()=>t.history.index<t.history.snapshots.length-1,redo:()=>{t.canRedo()&&(t.value=t.history.wip=t.clone(t.history.snapshots[++t.history.index]))},saveHistory:()=>{t.history.snapshots.splice(t.history.index+1),t.history.snapshots.push(p(t).value),++t.history.index},subscribe:()=>b(t,e=>{e.every(r=>r[1][0]==="value"&&(r[0]!=="set"||r[2]!==t.history.wip))&&t.saveHistory()})});return t.saveHistory(),s||t.subscribe(),t}function R(a){const s=y({data:Array.from(new Set(a)),has(t){return this.data.indexOf(t)!==-1},add(t){let e=!1;return typeof t=="object"&&t!==null&&(e=this.data.indexOf(y(t))!==-1),this.data.indexOf(t)===-1&&!e&&this.data.push(t),this},delete(t){const e=this.data.indexOf(t);return e===-1?!1:(this.data.splice(e,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},forEach(t){this.data.forEach(e=>{t(e,e,this)})},get[Symbol.toStringTag](){return"Set"},toJSON(){return new Set(this.data)},[Symbol.iterator](){return this.data[Symbol.iterator]()},values(){return this.data.values()},keys(){return this.data.values()},entries(){return new Set(this.data).entries()}});return Object.defineProperties(s,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(s),s}function z(a){const s=y({data:Array.from(a||[]),has(t){return this.data.some(e=>e[0]===t)},set(t,e){const r=this.data.find(o=>o[0]===t);return r?r[1]=e:this.data.push([t,e]),this},get(t){var e;return(e=this.data.find(r=>r[0]===t))==null?void 0:e[1]},delete(t){const e=this.data.findIndex(r=>r[0]===t);return e===-1?!1:(this.data.splice(e,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(t){this.data.forEach(e=>{t(e[1],e[0],this)})},keys(){return this.data.map(t=>t[0]).values()},values(){return this.data.map(t=>t[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(s,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(s),s}}}});
System.register(["valtio/vanilla","derive-valtio"],function(g){"use strict";var b,p,y,m,w,T;return{setters:[function(c){b=c.subscribe,p=c.snapshot,y=c.proxy,m=c.ref,w=c.unstable_buildProxyFunction},function(c){T=c.derive,g({derive:c.derive,underive:c.underive,unstable_deriveSubscriptions:c.unstable_deriveSubscriptions})}],execute:function(){g({addComputed:M,devtools:N,proxyMap:z,proxySet:R,proxyWithComputed:I,proxyWithHistory:H,subscribeKey:c,watch:D});function c(a,s,t,e){let n=a[s];return b(a,()=>{const o=a[s];Object.is(n,o)||t(n=o)},e)}let v;function D(a,s){let t=!0;const e=new Set,n=new Map,o=()=>{t&&(t=!1,e.forEach(i=>i()),e.clear(),n.forEach(i=>i()),n.clear())},l=async()=>{if(!t)return;e.forEach(d=>d()),e.clear();const i=new Set,O=v;v=e;try{const d=a(u=>{if(i.add(u),t&&!n.has(u)){const h=b(u,l,s==null?void 0:s.sync);n.set(u,h)}return u}),r=d&&d instanceof Promise?await d:d;r&&(t?e.add(r):o())}finally{v=O}n.forEach((d,r)=>{i.has(r)||(n.delete(r),d())})};return v&&v.add(o),l(),o}const E=Symbol();function N(a,s){typeof s=="string"&&(console.warn("string name option is deprecated, use { name }. https://github.com/pmndrs/valtio/pull/400"),s={name:s});const{enabled:t,name:e="",...n}=s||{};let o;try{o=(t!=null?t:!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!o)return;let l=!1;const i=o.connect({name:e,...n}),O=b(a,r=>{const u=r.filter(([h,f])=>f[0]!==E).map(([h,f])=>`${h}:${f.map(String).join(".")}`).join(", ");if(u)if(l)l=!1;else{const h=Object.assign({},p(a));delete h[E],i.send({type:u,updatedAt:new Date().toLocaleString()},h)}}),d=i.subscribe(r=>{var u,h,f,_,P,A;if(r.type==="ACTION"&&r.payload)try{Object.assign(a,JSON.parse(r.payload))}catch(S){console.error(`please dispatch a serializable value that JSON.parse() and proxy() support
`,S)}if(r.type==="DISPATCH"&&r.state){if(((u=r.payload)==null?void 0:u.type)==="JUMP_TO_ACTION"||((h=r.payload)==null?void 0:h.type)==="JUMP_TO_STATE"){l=!0;const S=JSON.parse(r.state);Object.assign(a,S)}a[E]=r}else if(r.type==="DISPATCH"&&((f=r.payload)==null?void 0:f.type)==="COMMIT")i.init(p(a));else if(r.type==="DISPATCH"&&((_=r.payload)==null?void 0:_.type)==="IMPORT_STATE"){const S=(P=r.payload.nextLiftedState)==null?void 0:P.actionsById,U=((A=r.payload.nextLiftedState)==null?void 0:A.computedStates)||[];l=!0,U.forEach(({state:k},C)=>{const L=S[C]||"No action found";Object.assign(a,k),C===0?i.init(p(a)):i.send(L,p(a))})}});return i.init(p(a)),()=>{O(),d==null||d()}}function M(a,s,t=a){const e={};return Object.keys(s).forEach(n=>{e[n]=o=>s[n](o(a))}),T(e,{proxy:t})}function I(a,s){Object.keys(s).forEach(e=>{if(Object.getOwnPropertyDescriptor(a,e))throw new Error("object property already defined");const n=s[e],{get:o,set:l}=typeof n=="function"?{get:n}:n,i={};i.get=()=>o(p(t)),l&&(i.set=O=>l(t,O)),Object.defineProperty(a,e,i)});const t=y(a);return t}const J=a=>typeof a=="object"&&a!==null;let x;const j=a=>{if(x||(x=w()[2]),!J(a)||x.has(a))return a;const s=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return Reflect.ownKeys(a).forEach(t=>{s[t]=j(a[t])}),s};function H(a,s=!1){const t=y({value:a,history:m({wip:void 0,snapshots:[],index:-1}),clone:j,canUndo:()=>t.history.index>0,undo:()=>{t.canUndo()&&(t.value=t.history.wip=t.clone(t.history.snapshots[--t.history.index]))},canRedo:()=>t.history.index<t.history.snapshots.length-1,redo:()=>{t.canRedo()&&(t.value=t.history.wip=t.clone(t.history.snapshots[++t.history.index]))},saveHistory:()=>{t.history.snapshots.splice(t.history.index+1),t.history.snapshots.push(p(t).value),++t.history.index},subscribe:()=>b(t,e=>{e.every(n=>n[1][0]==="value"&&(n[0]!=="set"||n[2]!==t.history.wip))&&t.saveHistory()})});return t.saveHistory(),s||t.subscribe(),t}function R(a){const s=y({data:Array.from(new Set(a)),has(t){return this.data.indexOf(t)!==-1},add(t){let e=!1;return typeof t=="object"&&t!==null&&(e=this.data.indexOf(y(t))!==-1),this.data.indexOf(t)===-1&&!e&&this.data.push(t),this},delete(t){const e=this.data.indexOf(t);return e===-1?!1:(this.data.splice(e,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},forEach(t){this.data.forEach(e=>{t(e,e,this)})},get[Symbol.toStringTag](){return"Set"},toJSON(){return new Set(this.data)},[Symbol.iterator](){return this.data[Symbol.iterator]()},values(){return this.data.values()},keys(){return this.data.values()},entries(){return new Set(this.data).entries()}});return Object.defineProperties(s,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(s),s}function z(a){const s=y({data:Array.from(a||[]),has(t){return this.data.some(e=>e[0]===t)},set(t,e){const n=this.data.find(o=>o[0]===t);return n?n[1]=e:this.data.push([t,e]),this},get(t){var e;return(e=this.data.find(n=>n[0]===t))==null?void 0:e[1]},delete(t){const e=this.data.findIndex(n=>n[0]===t);return e===-1?!1:(this.data.splice(e,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(t){this.data.forEach(e=>{t(e[1],e[0],this)})},keys(){return this.data.map(t=>t[0]).values()},values(){return this.data.map(t=>t[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(s,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(s),s}}}});

@@ -7,5 +7,5 @@ export { subscribeKey } from './utils/subscribeKey';

export { proxyWithComputed_DEPRECATED as proxyWithComputed } from './utils/proxyWithComputed';
export { proxyWithHistory } from './utils/proxyWithHistory';
export { proxyWithHistory_DEPRECATED as proxyWithHistory } from './utils/proxyWithHistory';
export { proxySet } from './utils/proxySet';
export { proxyMap } from './utils/proxyMap';
declare type Awaited<T> = T extends Promise<infer V> ? V : T;

@@ -26,4 +26,7 @@ import { INTERNAL_Snapshot as Snapshot } from 'valtio/vanilla';

* })
*
* @deprecated Please use the `valtio-history` package. eg.
* import { proxyWithHistory } from 'valtio-history'
*/
export declare function proxyWithHistory<V>(initialValue: V, skipSubscribe?: boolean): {
export declare function proxyWithHistory_DEPRECATED<V>(initialValue: V, skipSubscribe?: boolean): {
value: V;

@@ -30,0 +33,0 @@ history: {

@@ -7,5 +7,5 @@ export { subscribeKey } from './utils/subscribeKey';

export { proxyWithComputed_DEPRECATED as proxyWithComputed } from './utils/proxyWithComputed';
export { proxyWithHistory } from './utils/proxyWithHistory';
export { proxyWithHistory_DEPRECATED as proxyWithHistory } from './utils/proxyWithHistory';
export { proxySet } from './utils/proxySet';
export { proxyMap } from './utils/proxyMap';
declare type Awaited<T> = T extends Promise<infer V> ? V : T;

@@ -26,4 +26,7 @@ import { INTERNAL_Snapshot as Snapshot } from 'valtio/vanilla';

* })
*
* @deprecated Please use the `valtio-history` package. eg.
* import { proxyWithHistory } from 'valtio-history'
*/
export declare function proxyWithHistory<V>(initialValue: V, skipSubscribe?: boolean): {
export declare function proxyWithHistory_DEPRECATED<V>(initialValue: V, skipSubscribe?: boolean): {
value: V;

@@ -30,0 +33,0 @@ history: {

@@ -636,6 +636,9 @@ (function (global, factory) {

};
function proxyWithHistory(initialValue, skipSubscribe) {
function proxyWithHistory_DEPRECATED(initialValue, skipSubscribe) {
if (skipSubscribe === void 0) {
skipSubscribe = false;
}
{
console.warn('proxyWithHistory is deprecated. Please use the "valtio-history" package; refer to the docs');
}
var proxyObject = vanilla.proxy({

@@ -836,11 +839,11 @@ value: initialValue,

Object.defineProperty(exports, 'derive', {
Object.defineProperty(exports, "derive", {
enumerable: true,
get: function () { return deriveValtio.derive; }
});
Object.defineProperty(exports, 'underive', {
Object.defineProperty(exports, "underive", {
enumerable: true,
get: function () { return deriveValtio.underive; }
});
Object.defineProperty(exports, 'unstable_deriveSubscriptions', {
Object.defineProperty(exports, "unstable_deriveSubscriptions", {
enumerable: true,

@@ -854,3 +857,3 @@ get: function () { return deriveValtio.unstable_deriveSubscriptions; }

exports.proxyWithComputed = proxyWithComputed_DEPRECATED;
exports.proxyWithHistory = proxyWithHistory;
exports.proxyWithHistory = proxyWithHistory_DEPRECATED;
exports.subscribeKey = subscribeKey;

@@ -857,0 +860,0 @@ exports.watch = watch;

@@ -7,4 +7,4 @@ export { subscribeKey } from './utils/subscribeKey';

export { proxyWithComputed_DEPRECATED as proxyWithComputed } from './utils/proxyWithComputed';
export { proxyWithHistory } from './utils/proxyWithHistory';
export { proxyWithHistory_DEPRECATED as proxyWithHistory } from './utils/proxyWithHistory';
export { proxySet } from './utils/proxySet';
export { proxyMap } from './utils/proxyMap';

@@ -635,6 +635,9 @@ 'use strict';

};
function proxyWithHistory(initialValue, skipSubscribe) {
function proxyWithHistory_DEPRECATED(initialValue, skipSubscribe) {
if (skipSubscribe === void 0) {
skipSubscribe = false;
}
if (process.env.NODE_ENV !== 'production') {
console.warn('proxyWithHistory is deprecated. Please use the "valtio-history" package; refer to the docs');
}
var proxyObject = vanilla.proxy({

@@ -835,11 +838,11 @@ value: initialValue,

Object.defineProperty(exports, 'derive', {
Object.defineProperty(exports, "derive", {
enumerable: true,
get: function () { return deriveValtio.derive; }
});
Object.defineProperty(exports, 'underive', {
Object.defineProperty(exports, "underive", {
enumerable: true,
get: function () { return deriveValtio.underive; }
});
Object.defineProperty(exports, 'unstable_deriveSubscriptions', {
Object.defineProperty(exports, "unstable_deriveSubscriptions", {
enumerable: true,

@@ -853,4 +856,4 @@ get: function () { return deriveValtio.unstable_deriveSubscriptions; }

exports.proxyWithComputed = proxyWithComputed_DEPRECATED;
exports.proxyWithHistory = proxyWithHistory;
exports.proxyWithHistory = proxyWithHistory_DEPRECATED;
exports.subscribeKey = subscribeKey;
exports.watch = watch;

@@ -26,4 +26,7 @@ import type { INTERNAL_Snapshot as Snapshot } from 'valtio/vanilla';

* })
*
* @deprecated Please use the `valtio-history` package. eg.
* import { proxyWithHistory } from 'valtio-history'
*/
export declare function proxyWithHistory<V>(initialValue: V, skipSubscribe?: boolean): {
export declare function proxyWithHistory_DEPRECATED<V>(initialValue: V, skipSubscribe?: boolean): {
value: V;

@@ -30,0 +33,0 @@ history: {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet