ember-lifi

0.0.1 • Public • Published

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.

Package Sidebar

Install

npm i ember-lifi

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

229 kB

Total Files

11

Last publish

Collaborators

  • matt-jensen