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

@atomico/hooks

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atomico/hooks - npm Package Compare versions

Comparing version 3.11.0 to 3.11.1

2

package.json
{
"name": "@atomico/hooks",
"description": "Series of utilities in hooks format to extend the operation of Atomico",
"version": "3.11.0",
"version": "3.11.1",
"type": "module",

@@ -6,0 +6,0 @@ "workspaces": [

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

import { useState, useEffect } from "atomico";
import { useState, useEffect, Mark } from "atomico";
/**

@@ -12,6 +12,10 @@ *

const type = "slotchange";
// Take the existing children
setChildNodes(current.assignedNodes());
// handler subscriber to the event
const handler = () => setChildNodes(current.assignedNodes());
const handler = () =>
setChildNodes(
current.assignedNodes().filter((child) => !(child instanceof Mark))
);
// First load
handler();
// listener and unlistener

@@ -18,0 +22,0 @@ current.addEventListener(type, handler);

import { expect } from "@esm-bundle/chai";
import { Mark } from "atomico";
import { createHooks } from "atomico/test-hooks";

@@ -24,1 +25,21 @@ import { useSlot } from "./use-slot.js";

});
it("avoid Mark", () => {
const current = document.createElement("slot");
const host = document.createElement("div");
host.append(new Mark("Hidden"));
host.attachShadow({ mode: "open" }).append(current);
const ref = { current };
const hooks = createHooks(() => {
expect(render()).to.deep.equal([]); // next render
});
const render = () => hooks.load(() => useSlot(ref));
render(); // first render
hooks.cleanEffects()();
});
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