@zag-js/store
Advanced tools
Comparing version 0.0.0-dev-20220830133710 to 0.0.0-dev-20220919164136
@@ -1,33 +0,3 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
getHandler: () => getHandler, | ||
getVersion: () => getVersion, | ||
proxy: () => proxy, | ||
proxyWithComputed: () => proxyWithComputed, | ||
ref: () => ref, | ||
snapshot: () => snapshot, | ||
subscribe: () => subscribe | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_proxy_compare = require("proxy-compare"); | ||
import { getUntracked, markToTrack } from "proxy-compare"; | ||
var __DEV__ = process.env.NODE_ENV !== "production"; | ||
@@ -90,3 +60,3 @@ var VERSION = Symbol(); | ||
const snapshot2 = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target)); | ||
(0, import_proxy_compare.markToTrack)(snapshot2, true); | ||
markToTrack(snapshot2, true); | ||
snapshotCache.set(receiver, [version, snapshot2]); | ||
@@ -96,3 +66,3 @@ Reflect.ownKeys(target).forEach((key) => { | ||
if (refSet.has(value)) { | ||
(0, import_proxy_compare.markToTrack)(value, false); | ||
markToTrack(value, false); | ||
snapshot2[key] = value; | ||
@@ -165,3 +135,3 @@ } else if (value instanceof Promise) { | ||
if (isObject(value)) { | ||
value = (0, import_proxy_compare.getUntracked)(value) || value; | ||
value = getUntracked(value) || value; | ||
} | ||
@@ -264,4 +234,3 @@ let nextValue; | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
export { | ||
getHandler, | ||
@@ -274,2 +243,2 @@ getVersion, | ||
subscribe | ||
}); | ||
}; |
{ | ||
"type": "module", | ||
"name": "@zag-js/store", | ||
"version": "0.0.0-dev-20220830133710", | ||
"version": "0.0.0-dev-20220919164136", | ||
"description": "The reactive store package for zag machines", | ||
@@ -15,3 +16,2 @@ "keywords": [ | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
@@ -33,5 +33,5 @@ "repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/store", | ||
"scripts": { | ||
"build-fast": "tsup src/index.ts --format=esm,cjs", | ||
"build-fast": "tsup src/index.ts --format=esm", | ||
"start": "pnpm build --watch", | ||
"build": "tsup src/index.ts --format=esm,cjs --dts", | ||
"build": "tsup src/index.ts --format=esm --dts", | ||
"test": "jest --config ../../../jest.config.js --rootDir tests", | ||
@@ -38,0 +38,0 @@ "lint": "eslint src --ext .ts,.tsx", |
2
Yes
11709
5
262