Socket
Socket
Sign inDemoInstall

@prefresh/core

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prefresh/core - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

6

CHANGELOG.md
# @prefresh/core
## 1.1.0
### Minor Changes
- [`ac7c5d1`](https://github.com/JoviDeCroock/prefresh/commit/ac7c5d150bcbb9cea40060549b31a2ed06fcc5dc) [#202](https://github.com/JoviDeCroock/prefresh/pull/202) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Cleanup effects when resetting hooks state
## 1.0.0

@@ -4,0 +10,0 @@

2

package.json
{
"name": "@prefresh/core",
"version": "1.0.0",
"version": "1.1.0",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "exports": {

@@ -25,2 +25,4 @@ // Options for Preact.

const forbiddenEffectFields = ['__', '__H'];
function sign(type, key, forceReset, getCustomHooks, status) {

@@ -99,2 +101,32 @@ if (type) {

if (resetHookState) {
if (
vnode[VNODE_COMPONENT][COMPONENT_HOOKS] &&
vnode[VNODE_COMPONENT][COMPONENT_HOOKS][EFFECTS_LIST]
) {
vnode[VNODE_COMPONENT][COMPONENT_HOOKS][EFFECTS_LIST].forEach(
effect => {
const possibleCleanupKeys = Object.keys(effect).filter(
key => !forbiddenEffectFields.includes(key)
);
possibleCleanupKeys.forEach(key => {
if (typeof effect[key] == 'function') effect[key]();
});
}
);
}
if (vnode[VNODE_COMPONENT].__h) {
vnode[VNODE_COMPONENT].__h.forEach(possibleEffect => {
if (typeof possibleEffect === 'object') {
const possibleCleanupKeys = Object.keys(possibleEffect).filter(
key => !forbiddenEffectFields.includes(key)
);
possibleCleanupKeys.forEach(key => {
if (typeof possibleEffect[key] == 'function')
possibleEffect[key]();
});
}
});
}
vnode[VNODE_COMPONENT][COMPONENT_HOOKS] = {

@@ -101,0 +133,0 @@ [HOOKS_LIST]: [],

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