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

@maverick-js/signals

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maverick-js/signals - npm Package Compare versions

Comparing version 5.0.3 to 5.0.4

5

dist/dev/index.js

@@ -243,7 +243,6 @@ // src/scheduler.ts

try {
return compute(fn[SCOPE], fn, currentObserver);
compute(fn[SCOPE], fn, currentObserver);
} catch (error) {
handleError(fn, error);
}
return;
};

@@ -311,3 +310,3 @@ }

prevObserver = null;
if (true)
if (scope2)
computeStack.pop();

@@ -314,0 +313,0 @@ }

3

dist/prod/index.js

@@ -241,7 +241,6 @@ // src/scheduler.ts

try {
return compute(fn[SCOPE], fn, currentObserver);
compute(fn[SCOPE], fn, currentObserver);
} catch (error) {
handleError(fn, error);
}
return;
};

@@ -248,0 +247,0 @@ }

@@ -196,11 +196,7 @@ /**

* Scopes the given function to the current parent scope so context and error handling continue to
* work as expected. Generally this should be called on non-signal functions. A scoped
* function will return `undefined` if an error is thrown.
* work as expected.
*
* This is more compute and memory efficient than the alternative `effect(() => peek(callback))`
* because it doesn't require creating and tracking a `computed` signal.
*
* @see {@link https://github.com/maverick-js/signals#scope}
*/
export declare function scope<T>(fn: () => T): () => T | undefined;
export declare function scope(fn: () => void): () => void;

@@ -207,0 +203,0 @@ /**

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "5.0.3",
"version": "5.0.4",
"type": "module",

@@ -8,0 +8,0 @@ "module": "dist/prod/index.js",

@@ -516,8 +516,4 @@ # Signals

Scopes the given function to the current parent scope so context and error handling continue to
work as expected. Generally this should be called on non-signal functions. A scoped function will
return `undefined` if an error is thrown.
work as expected.
This is more compute and memory efficient than the alternative `effect(() => peek(callback))`
because it doesn't require creating and tracking a `computed` signal.
```js

@@ -529,3 +525,3 @@ import { root, scope } from '@maverick-js/signals';

root(() => {
// This is now scoped to root.
// The callback is now scoped to root.
callback = scope(() => {

@@ -532,0 +528,0 @@ // Context and error handling will work here.

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