ember-lifi
v0.0.1
Published
Service for detecting internet connection status
Downloads
2
Maintainers
Readme
ember-lifi
A small service for detecting internet connection
Installation
ember install ember-lifi
Usage
Basic
import { inject as service } from '@ember/service';
import { reads } from '@ember/object/computed';
export default Component.extend({
lifi: service(),
isOnline: reads('lifi.isOnline')
});
Events
import { inject as service } from '@ember/service';
export default Component.extend({
lifi: service(),
didInsertElement() {
this._super(...arguments);
this.get('lifi').on('offline', () => {
alert('The end is nigh!');
});
this.get('lifi').on('online', () => {
alert('False alarm');
});
}
});
Contributing
Installation
git clone <repository-url>
cd ember-lifi
nvm use
yarn
Linting
npm run lint:js
npm run 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"npm 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.