@solid-primitives/resize-observer
Advanced tools
Comparing version 0.0.105 to 1.0.0
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8438
6
135
0
37
Updatedsolid-js@^1.2.1