0.0.1 • Published 6 years ago

ember-lifi v0.0.1

Weekly downloads
26
License
MIT
Repository
github
Last release
6 years ago

ember-lifi Build Status Ember Observer Score Code Climate

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 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.