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 1.0.3 to 1.0.4

8

dist/index.d.ts

@@ -0,5 +1,9 @@

declare type ResizeHandler = (size: {
width: number;
height: number;
}, ref: Element) => void;
/**
* Create resize observer is a helper primitive for binding resize events.
*
* @param opts.refs - Either an `HTMLElement`, an array of `HTMLElement`s, or a signal returning one of these.
* @param opts.refs - Either an `Element`, an array of `Element`s, or a signal returning one of these.
* @param opts.onResize - Function handler to trigger on resize

@@ -9,3 +13,3 @@ * @return A callback that can be used to add refs to observe resizing

*/
declare function createResizeObserver<T extends HTMLElement>(opts: {
declare function createResizeObserver<T extends Element>(opts: {
onResize: ResizeHandler;

@@ -12,0 +16,0 @@ refs?: T | T[] | (() => T | T[]);

@@ -6,3 +6,3 @@ // src/index.ts

const refCallback = (e) => setOtherRefs((l) => l.concat(e));
const previousMap = new Map();
const previousMap = /* @__PURE__ */ new Map();
const resizeObserver = new ResizeObserver((entries) => {

@@ -9,0 +9,0 @@ if (!Array.isArray(entries)) {

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

@@ -13,3 +13,3 @@ "author": "Moshe Udimar",

"primitive": {
"name": "resiz-observer",
"name": "resize-observer",
"stage": 3,

@@ -48,3 +48,3 @@ "list": [

"devDependencies": {
"@types/jest": "^26.0.10",
"@types/jest": "^27.0.0",
"prettier": "^2.0.5",

@@ -56,4 +56,4 @@ "solid-testing-library": "^0.2.0",

},
"dependencies": {
"solid-js": "^1.2.1"
"peerDependencies": {
"solid-js": "1.3.0"
},

@@ -65,2 +65,2 @@ "jest": {

}
}
}

@@ -6,2 +6,3 @@ # solid-primitives/resize-observer

[![size](https://img.shields.io/npm/v/@solid-primitives/resize-observer?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/resize-observer)
[![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fdavedbase%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-3.json)](https://github.com/davedbase/solid-primitives#contribution-process)

@@ -25,3 +26,3 @@ Provides a reactive resize observer wrapper.

```ts
const [refCallback] = createResizeObserver(() => console.log("resized"));
const refCallback = createResizeObserver(() => console.log("resized"));
```

@@ -42,2 +43,6 @@

1.0.4
Patched HTMLElement to Element to resolve type error on buildd. Updated to Solid 1.3.
</details>

@@ -44,0 +49,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