Package Exports
- detect-resize
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (detect-resize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
detect-resize
Slightly refactored version of https://github.com/sdecima/javascript-detect-element-resize targeting universal React applications. Will not throw if imported (ES6) on the server.
Install
npm i -S detect-resize
How to use
Should work the same as javascript-detect-element-resize without throwing errors if used in a server environment.
import { addResizeListener, removeResizeListener } from 'detect-resize'
const resizeElement = document.getElementById('resizeElement'),
const handleResize = () => { console.info('resized') }
addResizeListener(resizeElement, handleResize)
removeResizeListener(resizeElement, handleResize)