Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solid-primitives/resize-observer

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/resize-observer - npm Package Compare versions

Comparing version 2.0.6 to 2.0.7

2

dist/index.d.ts

@@ -84,3 +84,3 @@ import { Accessor } from 'solid-js';

*/
declare function createElementSize(target: MaybeAccessor<Element>): {
declare function createElementSize(target: Element): {
readonly width: number;

@@ -87,0 +87,0 @@ readonly height: number;

import { onCleanup, $PROXY, createEffect, on, onMount, $TRACK } from 'solid-js';
import { asArray, handleDiffArray, createStaticStore, access } from '@solid-primitives/utils';
import { asArray, handleDiffArray, createStaticStore } from '@solid-primitives/utils';
import { createSharedRoot } from '@solid-primitives/rootless';

@@ -61,6 +61,3 @@ import { makeEventListener } from '@solid-primitives/event-listener';

if (!target)
return {
width: null,
height: null
};
return { width: null, height: null };
const { width, height } = target.getBoundingClientRect();

@@ -70,5 +67,8 @@ return { width, height };

function createElementSize(target) {
const [size, setSize] = createStaticStore(getElementSize(access(target)));
if (typeof target === "function")
onMount(() => setSize(getElementSize(target())));
const [size, setSize] = createStaticStore(
typeof target !== "function" ? getElementSize(target) : (() => {
onMount(() => setSize(getElementSize(target())));
return { width: null, height: null };
})()
);
const updateSize = (e) => setSize({ width: e.width, height: e.height });

@@ -75,0 +75,0 @@ createResizeObserver(typeof target === "function" ? () => target() || [] : target, updateSize);

@@ -30,6 +30,3 @@ import 'solid-js';

function getElementSize(target) {
return {
width: null,
height: null
};
return { width: null, height: null };
}

@@ -36,0 +33,0 @@ function createElementSize(target) {

{
"name": "@solid-primitives/resize-observer",
"version": "2.0.6",
"version": "2.0.7",
"description": "Reactive primitives for observing resizing of HTML elements.",

@@ -69,5 +69,2 @@ "author": "Moshe Udimar",

},
"devDependencies": {
"solid-js": "^1.6.0"
},
"peerDependencies": {

@@ -74,0 +71,0 @@ "solid-js": "^1.6.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