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

fluidstate

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluidstate - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

10

nodes.js

@@ -86,8 +86,14 @@ "use strict";

const createEffect = (calculate, perform) => {
const effectId = {};
const effectId = Symbol();
let isInitial = true;
let isEffectScheduled = false;
const computed = createComputed(() => {
const computedValue = calculate();
updateManager.addEffect(effectId, () => perform(computedValue));
isEffectScheduled = updateManager.addEffect(effectId, isInitial, () => perform(computedValue));
return computedValue;
});
isInitial = false;
if (!isEffectScheduled) {
perform(computed.inert.get());
}
return () => {

@@ -94,0 +100,0 @@ dependenciesManager.disableComputed(computed);

2

package.json
{
"name": "fluidstate",
"version": "0.0.10",
"version": "0.0.11",
"description": "Library for fine-grained reactivity state management",

@@ -5,0 +5,0 @@ "repository": "https://gitlab.com/fluidstate/fluidstate",

@@ -10,4 +10,4 @@ import { DependenciesManager } from "./dependencies-manager";

batch: (update: () => void) => void;
addEffect: (effectId: object, perform: () => void) => void;
cancelEffect: (effectId: object) => void;
addEffect: (effectId: symbol, isInitial: boolean, perform: () => void) => boolean;
cancelEffect: (effectId: symbol) => void;
triggerUpdate: ({ shouldResolveImmediatelyAfterBatch, }?: {

@@ -14,0 +14,0 @@ shouldResolveImmediatelyAfterBatch?: boolean | undefined;

@@ -161,5 +161,11 @@ "use strict";

};
const addEffect = (effectId, perform) => {
const addEffect = (effectId, isInitial, perform) => {
if (!isUpdateInProgress()) {
perform();
// The following condition is just in case of a possible future refactor;
// currently can't think of a situation where it may happen
if (!isInitial) {
perform();
return true;
}
return false;
} else {

@@ -171,2 +177,3 @@ cancelEffect(effectId);

});
return true;
}

@@ -173,0 +180,0 @@ };

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