New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aha-app/react-easy-state

Package Overview
Dependencies
Maintainers
40
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aha-app/react-easy-state - npm Package Compare versions

Comparing version 0.0.11-development to 0.0.12-development

38

dist/cjs.es5.js

@@ -298,26 +298,22 @@ 'use strict';

function runBatch() {
var batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
reactPlatform_cjs.unstable_batchedUpdates(function () {
return Object.values(batchesToRun).forEach(function (setStateFn) {
return setStateFn();
});
});
}
function batchSetState(viewIndex, fn) {
if (inEventLoop) {
// If we are in the main event loop, React handles the batching
// automatically, so we run the change immediately. Deferring the
// update can cause unexpected cursor shifts in input elements,
// since the change can't be tied back to the action:
// https://github.com/facebook/react/issues/5386
fn();
return;
}
batchesPending[viewIndex] = fn;
if (!taskPending) {
taskPending = true;
taskPending = true; // If we're in an event handler, we'll run the batch at the end of it.
if (inEventLoop) return;
queueMicrotask(function () {
var batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
reactPlatform_cjs.unstable_batchedUpdates(function () {
return Object.values(batchesToRun).forEach(function (setStateFn) {
return setStateFn();
});
});
runBatch();
});

@@ -387,2 +383,6 @@ }

fn.apply(ctx, args);
if (taskPending) {
runBatch();
}
} finally {

@@ -389,0 +389,0 @@ inEventLoop = false;

@@ -42,22 +42,18 @@ 'use strict';

function runBatch() {
const batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
reactPlatform_cjs.unstable_batchedUpdates(() => Object.values(batchesToRun).forEach(setStateFn => setStateFn()));
}
function batchSetState(viewIndex, fn) {
if (inEventLoop) {
// If we are in the main event loop, React handles the batching
// automatically, so we run the change immediately. Deferring the
// update can cause unexpected cursor shifts in input elements,
// since the change can't be tied back to the action:
// https://github.com/facebook/react/issues/5386
fn();
return;
}
batchesPending[viewIndex] = fn;
if (!taskPending) {
taskPending = true;
taskPending = true; // If we're in an event handler, we'll run the batch at the end of it.
if (inEventLoop) return;
queueMicrotask(() => {
const batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
reactPlatform_cjs.unstable_batchedUpdates(() => Object.values(batchesToRun).forEach(setStateFn => setStateFn()));
runBatch();
});

@@ -120,2 +116,6 @@ }

fn.apply(ctx, args);
if (taskPending) {
runBatch();
}
} finally {

@@ -122,0 +122,0 @@ inEventLoop = false;

@@ -295,26 +295,22 @@ import { useState, memo, useMemo, useEffect, Component } from 'react';

function runBatch() {
var batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
unstable_batchedUpdates(function () {
return Object.values(batchesToRun).forEach(function (setStateFn) {
return setStateFn();
});
});
}
function batchSetState(viewIndex, fn) {
if (inEventLoop) {
// If we are in the main event loop, React handles the batching
// automatically, so we run the change immediately. Deferring the
// update can cause unexpected cursor shifts in input elements,
// since the change can't be tied back to the action:
// https://github.com/facebook/react/issues/5386
fn();
return;
}
batchesPending[viewIndex] = fn;
if (!taskPending) {
taskPending = true;
taskPending = true; // If we're in an event handler, we'll run the batch at the end of it.
if (inEventLoop) return;
queueMicrotask(function () {
var batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
unstable_batchedUpdates(function () {
return Object.values(batchesToRun).forEach(function (setStateFn) {
return setStateFn();
});
});
runBatch();
});

@@ -384,2 +380,6 @@ }

fn.apply(ctx, args);
if (taskPending) {
runBatch();
}
} finally {

@@ -386,0 +386,0 @@ inEventLoop = false;

@@ -39,22 +39,18 @@ import { useState, memo, useMemo, useEffect, Component } from 'react';

function runBatch() {
const batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
unstable_batchedUpdates(() => Object.values(batchesToRun).forEach(setStateFn => setStateFn()));
}
function batchSetState(viewIndex, fn) {
if (inEventLoop) {
// If we are in the main event loop, React handles the batching
// automatically, so we run the change immediately. Deferring the
// update can cause unexpected cursor shifts in input elements,
// since the change can't be tied back to the action:
// https://github.com/facebook/react/issues/5386
fn();
return;
}
batchesPending[viewIndex] = fn;
if (!taskPending) {
taskPending = true;
taskPending = true; // If we're in an event handler, we'll run the batch at the end of it.
if (inEventLoop) return;
queueMicrotask(() => {
const batchesToRun = batchesPending;
taskPending = false;
batchesPending = {};
unstable_batchedUpdates(() => Object.values(batchesToRun).forEach(setStateFn => setStateFn()));
runBatch();
});

@@ -117,2 +113,6 @@ }

fn.apply(ctx, args);
if (taskPending) {
runBatch();
}
} finally {

@@ -119,0 +119,0 @@ inEventLoop = false;

{
"name": "@aha-app/react-easy-state",
"version": "0.0.11-development",
"version": "0.0.12-development",
"description": "React state management with a minimal API. Made with ES6 Proxies.",

@@ -62,3 +62,3 @@ "main": "dist/cjs.es6.js",

"dependencies": {
"@nx-js/observer-util": "^4.2.2"
"@nx-js/observer-util": "^4.3.0-alpha.2"
},

@@ -65,0 +65,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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