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
2
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 0.0.105 to 1.0.0

dist/cjs/index.js

4

dist/index.d.ts

@@ -1,6 +0,6 @@

declare type ObservedSize = {
export declare type ObservedSize = {
width: number | undefined;
height: number | undefined;
};
declare type ResizeHandler = (size: ObservedSize, ref: Element) => void;
export declare type ResizeHandler = (size: ObservedSize, ref: Element) => void;
/**

@@ -7,0 +7,0 @@ * Create resize observer is a helper primitive for binding resize events.

@@ -15,3 +15,3 @@ import { createEffect, createSignal, onCleanup } from "solid-js";

const previousMap = new Map();
const resizeObserver = new ResizeObserver((entries) => {
const resizeObserver = new ResizeObserver(entries => {
if (!Array.isArray(entries)) {

@@ -42,3 +42,3 @@ return;

oldRefs = oldRefs || [];
oldRefs.forEach((oldRef) => {
oldRefs.forEach(oldRef => {
if (!(oldRef in refs)) {

@@ -49,3 +49,3 @@ resizeObserver.unobserve(oldRef);

});
refs.forEach((ref) => {
refs.forEach(ref => {
if (!(ref in oldRefs)) {

@@ -52,0 +52,0 @@ resizeObserver.observe(ref);

{
"name": "@solid-primitives/resize-observer",
"version": "0.0.105",
"version": "1.0.0",
"description": "Primitive to observer browser resizes",

@@ -15,2 +15,7 @@ "author": "Moshe Udimar",

],
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"sideEffects": "false",

@@ -20,3 +25,3 @@ "scripts": {

"clean": "rimraf dist/",
"build": "tsc"
"build": "tsc && tsc --target es5 --module commonjs --declaration false --outDir ./dist/cjs"
},

@@ -37,3 +42,3 @@ "keywords": [

"dependencies": {
"solid-js": "^1.0.3"
"solid-js": "^1.2.1"
},

@@ -45,2 +50,2 @@ "jest": {

}
}
}

@@ -0,3 +1,15 @@

---
Name: resize-observer
Stage: 3
Package: "@solid-primitives/resize-observer"
Primitives: createResizeObserver
Category: Display & Media
---
# solid-primitives/resize-observer
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/resize-observer)](https://bundlephobia.com/package/@solid-primitives/resize-observer)
[![size](https://img.shields.io/npm/v/@solid-primitives/resize-observer)](https://www.npmjs.com/package/@solid-primitives/resize-observer)
Provides a reactive resize observer wrapper.

@@ -16,2 +28,6 @@

1.0.0
Release initial version for CJS support.
</details>

@@ -18,0 +34,0 @@

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