🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@semantq/state

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semantq/state - npm Package Compare versions

Comparing version
1.0.6
to
1.0.7
+2
-0
core/index.js

@@ -15,3 +15,5 @@ // index.js

export { $props };
export { $getValue, $getValueMemo } from './pulse.js';
// Binding utilities (grouped under `state`)

@@ -18,0 +20,0 @@ export const state = {

//pulse
import { PulseCore } from './PulseCore.js';
export function $getValue(proxy) {
if (!proxy) return proxy;
// Fast path for PulseCore instances
if (proxy instanceof PulseCore) return proxy._value;
// Compatibility path for other reactive objects
if (typeof proxy === 'object') {
if ('_value' in proxy) return proxy._value;
if ('value' in proxy) return proxy.value;
}
return proxy;
}
// Memoized version
const valueCache = new WeakMap();
export function $getValueMemo(proxy) {
if (!proxy) return proxy;
if (valueCache.has(proxy)) return valueCache.get(proxy);
const value = $getValue(proxy);
valueCache.set(proxy, value);
return value;
}
export function pulse(initialValue, options = {}) {

@@ -5,0 +33,0 @@ const { key, storage = localStorage } = options;

+1
-1
{
"name": "@semantq/state",
"version": "1.0.6",
"version": "1.0.7",
"description": "A reactivity state management system for Semantq",

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