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

forgo-state

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forgo-state - npm Package Compare versions

Comparing version 1.0.42 to 1.1.0

19

dist/index.js

@@ -41,3 +41,6 @@ /*

// concat latest updates with pending updates.
const argsToUpdatePlusPendingArgs = argsToRenderInTheNextCycle.concat(argsListToUpdate.filter((x) => !argsToRenderInTheNextCycle.includes(x)));
const argsToUpdatePlusPendingArgs = Array.from(new Set([
...Array.from(argsToRenderInTheNextCycle),
...argsListToUpdate,
]));
const componentStatesAndArgs = argsToUpdatePlusPendingArgs.map((x) => {

@@ -73,5 +76,4 @@ const state = getForgoState(x.element.node);

});
argsToRenderInTheNextCycle.length = 0;
for (const [, args] of componentsToUpdate) {
argsToRenderInTheNextCycle.push(args);
argsToRenderInTheNextCycle.add(args);
}

@@ -87,11 +89,16 @@ setTimeout(() => {

}
let argsToRenderInTheNextCycle = [];
// We make this a Set because if rendering a component triggers another
// forgo-state update we want to be sure we still finish updating everything we
// had queued, plus everything the subrender enqueues
const argsToRenderInTheNextCycle = new Set();
function doRender() {
if (argsToRenderInTheNextCycle.length) {
if (argsToRenderInTheNextCycle.size > 0) {
for (const args of argsToRenderInTheNextCycle) {
if (args.element.node && args.element.node.isConnected) {
// Dequeue the component before the render, so that if the component
// triggers more renders of itself they don't get no-op'd
argsToRenderInTheNextCycle.delete(args);
rerender(args.element);
}
}
argsToRenderInTheNextCycle.length = 0;
}

@@ -98,0 +105,0 @@ }

{
"name": "forgo-state",
"version": "1.0.42",
"version": "1.1.0",
"type": "module",

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

@@ -83,4 +83,7 @@ /*

// concat latest updates with pending updates.
const argsToUpdatePlusPendingArgs = argsToRenderInTheNextCycle.concat(
argsListToUpdate.filter((x) => !argsToRenderInTheNextCycle.includes(x))
const argsToUpdatePlusPendingArgs = Array.from(
new Set([
...Array.from(argsToRenderInTheNextCycle),
...argsListToUpdate,
])
);

@@ -135,5 +138,4 @@

argsToRenderInTheNextCycle.length = 0;
for (const [, args] of componentsToUpdate) {
argsToRenderInTheNextCycle.push(args);
argsToRenderInTheNextCycle.add(args);
}

@@ -154,12 +156,18 @@

let argsToRenderInTheNextCycle: ForgoRenderArgs[] = [];
// We make this a Set because if rendering a component triggers another
// forgo-state update we want to be sure we still finish updating everything we
// had queued, plus everything the subrender enqueues
const argsToRenderInTheNextCycle = new Set<ForgoRenderArgs>();
function doRender() {
if (argsToRenderInTheNextCycle.length) {
if (argsToRenderInTheNextCycle.size > 0) {
for (const args of argsToRenderInTheNextCycle) {
if (args.element.node && args.element.node.isConnected) {
// Dequeue the component before the render, so that if the component
// triggers more renders of itself they don't get no-op'd
argsToRenderInTheNextCycle.delete(args);
rerender(args.element);
}
}
argsToRenderInTheNextCycle.length = 0;
}

@@ -166,0 +174,0 @@ }

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