@juggle/resize-observer
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -40,3 +40,5 @@ const watchers = []; | ||
window.addEventListener('resize', notify); | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(notify).observe(document.body, observerConfig); | ||
if ('MutationObserver' in window) { | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(notify).observe(document.body, observerConfig); | ||
} |
@@ -0,3 +1,4 @@ | ||
import ResizeObserverCallback from './ResizeObserverCallback'; | ||
export default class ResizeObserver { | ||
private constructor(); | ||
constructor(callback: ResizeObserverCallback); | ||
observe(target: Element): void; | ||
@@ -4,0 +5,0 @@ unobserve(target: Element): void; |
{ | ||
"name": "@juggle/resize-observer", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "ResizeObserver class based on the draft specification", | ||
@@ -11,3 +11,3 @@ "main": "./lib/ResizeObserver.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest --coverage" | ||
}, | ||
@@ -19,2 +19,3 @@ "repository": { | ||
"keywords": [ | ||
"ResizeObserver", | ||
"resize", | ||
@@ -27,4 +28,13 @@ "observer", | ||
"component", | ||
"web components", | ||
"webcomponents", | ||
"polyfill", | ||
"ponyfill" | ||
"ponyfill", | ||
"event", | ||
"vue", | ||
"react", | ||
"angular", | ||
"polymer", | ||
"lit", | ||
"html" | ||
], | ||
@@ -36,3 +46,12 @@ "author": "Juggle", | ||
}, | ||
"homepage": "https://github.com/juggle/resize-observer#readme" | ||
"homepage": "https://github.com/juggle/resize-observer#readme", | ||
"devDependencies": { | ||
"@types/jest": "^23.3.12", | ||
"jest": "^23.6.0", | ||
"jest-cli": "^23.6.0", | ||
"jsdom": "^13.1.0", | ||
"sinon": "^7.2.2", | ||
"ts-jest": "^23.10.5", | ||
"typescript": "^3.2.2" | ||
} | ||
} |
@@ -52,3 +52,5 @@ type StandardCallback = () => any; | ||
// Listen for any other DOM changes which could affect sizes | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(notify).observe(document.body, observerConfig); | ||
if ('MutationObserver' in window) { | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(notify).observe(document.body, observerConfig); | ||
} |
@@ -6,3 +6,3 @@ import ResizeObserverController from './ResizeObserverController'; | ||
private constructor (callback: ResizeObserverCallback) { | ||
public constructor (callback: ResizeObserverCallback) { | ||
ResizeObserverController.connect(this, callback); | ||
@@ -9,0 +9,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 tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
20096
475
1
7