Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@preact-signals/unified-signals

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@preact-signals/unified-signals - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

6

CHANGELOG.md
# @preact-signals/unified-signals
## 0.2.6
### Patch Changes
- db33dd8: Changed untrackedPolyfill implementation
## 0.2.5

@@ -4,0 +10,0 @@

2

package.json
{
"name": "@preact-signals/unified-signals",
"version": "0.2.5",
"version": "0.2.6",
"private": false,

@@ -5,0 +5,0 @@ "publishConfig": {

@@ -6,16 +6,6 @@ import * as signals from "@preact/signals-react";

let untrackedDepth = 0;
const untrackedEffect = <T>(callback: () => T): T => {
let isExecuted = false;
const _polyfill = <T>(callback: () => T): T => {
let res: T | undefined;
signals.effect(() => {
if (isExecuted) {
return;
}
try {
res = callback();
} finally {
isExecuted = true;
}
signals.effect(() => () => {
res = callback();
})();

@@ -26,18 +16,2 @@

export const untrackedPolyfill: Untracked =
maybeUntracked ??
(<T>(callback: () => T): T => {
untrackedDepth++;
try {
// @ts-expect-error process is not defined and bla bla bla
if (process.env.NODE_ENV === "development" && untrackedDepth > 100_000) {
throw new Error("untracked depth exceeded: 100_000");
}
if (untrackedDepth > 1) {
return callback();
}
return untrackedEffect(callback);
} finally {
untrackedDepth--;
}
});
export const untrackedPolyfill: Untracked = maybeUntracked ?? _polyfill;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc