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.35.1 to 3.36.0

src/use-attributes/use-attributes.js

22

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

@@ -34,2 +34,3 @@ "workspaces": [

"./use-async-effect": "./src/use-async-effect/use-async-effect.js",
"./use-attributes": "./src/use-attributes/use-attributes.js",
"./use-channel": "./src/use-channel/use-channel.js",

@@ -65,2 +66,3 @@ "./use-child-nodes": "./src/use-child-nodes/use-child-nodes.js",

"./use-router": "./src/use-router/use-router.js",
"./use-script": "./src/use-script/use-script.js",
"./use-slot": "./src/use-slot/use-slot.js",

@@ -88,2 +90,11 @@ "./use-unique-id-selector": "./src/use-unique-id-selector/use-unique-id-selector.js"

],
"use-current-value": [
"./types/use-current-value/use-current-value.d.ts"
],
"use-mutation-observer": [
"./types/use-mutation-observer/use-mutation-observer.d.ts"
],
"use-attributes": [
"./types/use-attributes/use-attributes.d.ts"
],
"use-channel": [

@@ -95,5 +106,2 @@ "./types/use-channel/use-channel.d.ts"

],
"use-current-value": [
"./types/use-current-value/use-current-value.d.ts"
],
"use-listener": [

@@ -126,5 +134,2 @@ "./types/use-listener/use-listener.d.ts"

],
"use-mutation-observer": [
"./types/use-mutation-observer/use-mutation-observer.d.ts"
],
"use-disabled": [

@@ -184,2 +189,5 @@ "./types/use-disabled/use-disabled.d.ts"

],
"use-script": [
"./types/use-script/use-script.d.ts"
],
"use-unique-id-selector": [

@@ -186,0 +194,0 @@ "./types/use-unique-id-selector/use-unique-id-selector.d.ts"

@@ -6,6 +6,7 @@ import { expect } from "@esm-bundle/chai";

it("useResponsiveState <= 320px", (done) => {
it("useResponsiveState <= 320px", async () => {
const current = document.createElement("div");
const ref = { current };
let step = 0;
const results = [];

@@ -18,14 +19,3 @@ document.body.appendChild(current);

const value = useResizeState(ref, "no, yes 320px");
switch (step++) {
case 0:
expect(value).to.undefined;
break;
case 1:
expect(value).to.equal("yes");
break;
case 2:
expect(value).to.equal("no");
done();
break;
}
results.push(value);
};

@@ -37,5 +27,11 @@

setViewport({ width: 360, height: 640 }).then(() => {
setViewport({ width: 200, height: 640 });
});
await setViewport({ width: 360, height: 640 });
await new Promise((resolve) => setTimeout(resolve, 100));
await setViewport({ width: 200, height: 640 });
await new Promise((resolve) => setTimeout(resolve, 100));
expect(results).to.deep.equal([undefined, "yes", "no"]);
});
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