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

fluidstate-preact

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluidstate-preact - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

64

hoc.js

@@ -25,30 +25,48 @@ "use strict";

// and in a way that preserves hook order
const stopEffect = (0, _onceRef.useOnceRef)(() => api.createEffect(() => {
// This subscribes to renderControl, which allows us
// to rerun computed at the right time
api.get(renderControl.current);
if (data.current.isWithinRender) {
data.current.result = Component(...argsRef.current);
} else {
// When not within render context, we shouldn't rerun
// Component render. Instead, we simply ask Preact to rerender
if (data.current.isInitialized) {
return true;
const effect = (0, _onceRef.useOnceRef)(() => {
let dependencies = new Set();
const computed = api.createComputed(() => {
// This subscribes to renderControl, which allows us
// to rerun computed at the right time
api.get(renderControl.current);
if (data.current.isWithinRender) {
data.current.result = Component(...argsRef.current);
dependencies = new Set(computed.dependencies);
} else {
data.current.isInitialized = true;
// Getting dependencies to preserve the same dependency list
for (const dependency of dependencies) {
api.get(dependency);
}
// When not within render context, we shouldn't rerun
// Component render. Instead, we simply ask Preact to rerender
if (data.current.isInitialized) {
return true;
} else {
data.current.isInitialized = true;
}
}
}
return false;
}, shouldRerender => {
if (shouldRerender) {
rerender(Symbol());
// @ts-ignore
if (0 && _testCounter.testCounter.increaseCount) {
_testCounter.testCounter.increaseCount();
return false;
});
const stopEffect = api.createEffect(() => api.get(computed), shouldRerender => {
if (shouldRerender) {
rerender(Symbol());
// @ts-ignore
if (0 && _testCounter.testCounter.increaseCount) {
_testCounter.testCounter.increaseCount();
}
}
}
}));
});
return {
computed,
stopEffect
};
});
(0, _hooks.useEffect)(() => {
return () => {
stopEffect.current();
const {
computed,
stopEffect
} = effect.current;
api.disableComputed(computed);
stopEffect();
};

@@ -55,0 +73,0 @@ }, []);

{
"name": "fluidstate-preact",
"version": "0.0.14",
"version": "0.0.15",
"description": "Library for using fine-grained reactivity state management library fluidstate in Preact",

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

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