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

quarx

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quarx - npm Package Compare versions

Comparing version 5.3.0 to 5.4.0

2

package.json
{
"name": "quarx",
"version": "5.3.0",
"version": "5.4.0",
"description": "Simple tiny reactivity engine",

@@ -5,0 +5,0 @@ "type": "module",

@@ -16,4 +16,6 @@ import { autorun, createAtom } from './core.js';

let result, error;
const off = subscribe(value => result = value, e => error = e, e => error = e);
off();
const off = subscribe(value => {result = value}, e => {error = e}, e => {error = e});
if (off) off();
if (error) throw error;

@@ -29,3 +31,3 @@ return result;

let result, error;
let result, error, subscribed = false;

@@ -40,7 +42,18 @@ function set(e, r) {

const atom = createAtom(() => subscribe(r => set(null, r), set, set), { name });
function start() {
const off = subscribe(r => set(null, r), set, set);
subscribed = true;
return () => {
if (off) off();
subscribed = false;
}
}
const atom = createAtom(start, { name });
return {
get() {
if (!atom.reportObserved()) {
atom.reportObserved();
if (!subscribed) {
return get({ subscribe });

@@ -47,0 +60,0 @@ }

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