Huge News!Announcing our $40M Series B led by Abstract Ventures.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.3 to 0.0.4

8

nodes.js

@@ -89,12 +89,8 @@ "use strict";

const createEffect = (calculate, perform) => {
const effectIndicator = {};
const computed = createComputed(() => {
const computedValue = calculate();
updateManager.scheduleEffect(effectIndicator, () => perform(computedValue));
updateManager.callWithoutCollect(() => perform(computedValue));
return computedValue;
});
return () => {
dependenciesManager.disableComputed(computed);
updateManager.cancelEffect(effectIndicator);
};
return () => dependenciesManager.disableComputed(computed);
};

@@ -101,0 +97,0 @@ return {

{
"name": "fluidstate",
"version": "0.0.3",
"version": "0.0.4",
"description": "Library for fine-grained reactivity state management",

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

@@ -1,1 +0,1 @@

# Fluid State
# fluidstate

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

get: <T_2>(node: Node<T_2>) => T_2;
scheduleEffect: (effectIndicator: object, perform: () => void) => void;
cancelEffect: (effectIndicator: object) => void;
callWithoutCollect: <T_3>(fn: () => T_3) => T_3;
batch: (update: () => void) => void;
};

@@ -91,22 +91,2 @@ "use strict";

};
let scheduledEffects = new Map();
const scheduleEffect = (effectIndicator, perform) => {
scheduledEffects.set(effectIndicator, perform);
if (scheduledUpdates.length === 0) {
performAllEffects();
}
};
const cancelEffect = effectIndicator => {
scheduledEffects.delete(effectIndicator);
};
const performAllEffects = () => {
const currentScheduledEffects = scheduledEffects;
scheduledEffects = new Map();
for (let [, perform] of currentScheduledEffects) {
callWithoutCollect(perform);
}
if (scheduledUpdates.length > 0) {
triggerUpdate();
}
};
const triggerUpdate = () => {

@@ -124,3 +104,2 @@ // If we call triggerUpdate() after the update was

if (scheduledUpdates.length === 0) {
performAllEffects();
return;

@@ -136,3 +115,2 @@ }

cleanupUpdate();
performAllEffects();
}

@@ -148,4 +126,3 @@ };

get,
scheduleEffect,
cancelEffect,
callWithoutCollect,
batch

@@ -152,0 +129,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