ember-resize-observer

0.1.0 • Public • Published

ember-resize-observer

Adds a polyfill for ResizeObserver to your app, as well as a mixin to watch resizing of components.

Installation

ember install ember-resize-observer

Usage

To watch for resizing of a component element, import and use the mixin.

import Component from '@ember/component';
import ResizeObservable from 'ember-resize-observer/mixins/resize-observable';
 
export default Component.extend(ResizeObservable, {
  // observedResize will be called any time the component's element is resized
  observedResize() {
 
  }
});

The mixin also makes use of the init, didInsertElement, and willDestroyElement hooks. If your component makes use of any of these, it's important to remember to call this._super.

Contributing

Installation

  • git clone <repository-url>
  • cd ember-resize-observer
  • npm install

Linting

  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • npm test – Runs ember try:each to test your addon against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i ember-resize-observer

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

6.42 kB

Total Files

6

Last publish

Collaborators

  • gmurphey