ember-resize-aware
v1.2.0
Published
Ember Component mixin to notify of size changes.
Downloads
1,073
Readme
ember-resize-aware
Checkout the DEMO
Simplified and updated version of ember-resize
.
Provides a mixin that you can use on your components, your components will have a didResize
event called on them when appropriate.
Uses ember-singularity under the hood for efficient and massively gangster event handling.
Installation
ember install ember-resize-aware
Usage
Just mix this sucker into a component or any ember object with the didInsertElement
lifecycle hooks.
import Component from '@ember/component';
import ResizeAware from 'ember-resize-aware/mixins/resize-aware';
export default Component.extend(ResizeAware, {
debounceRate: 400, // You can optionally set the debounce rate, the default is 200, 0 during testing.
didResize(width, height) {
// YOU GET THE WIDTH! AND THE HEIGHT! BOOM!
},
});
Contributing
Installation
git clone <repository-url>
cd ember-resize-aware
yarn install
Linting
yarn lint:js
yarn lint:js --fix
Running tests
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"yarn test
– Runsember try:each
to test your addon against multiple Ember versions
Running the dummy application
ember serve
- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
License
This project is licensed under the MIT License.