# ember-lifi

> Service for detecting internet connection status

Latest version **0.0.1** (published 2018-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-lifi
pnpm add ember-lifi
yarn add ember-lifi
bun add ember-lifi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-02-20 |
| First published | 2018-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^4.5 \|\| 6.* \|\| >= 7.* |
| Dependencies | 1 |
| Unpacked size | 223.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Matt-Jensen |
| Maintainers | matt-jensen |
| Keywords | ember-addon, offline, connection, internet, wifi |

## Links

- npm: https://www.npmjs.com/package/ember-lifi
- Repository: https://github.com/matt-jensen/ember-lifi
- Homepage: https://github.com/matt-jensen/ember-lifi#readme
- Issues: https://github.com/matt-jensen/ember-lifi/issues
- npm.io page: https://npm.io/package/ember-lifi

## Dependencies (1)

- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^6.6.0

## Recent versions

- 0.0.1 (latest) — 2018-02-20
- 0.0.0 — 2018-02-19

## README

# ember-lifi [![Build Status](https://travis-ci.org/Matt-Jensen/ember-lifi.svg?branch=master)](https://travis-ci.org/Matt-Jensen/ember-lifi) [![Ember Observer Score](http://emberobserver.com/badges/ember-lifi.svg)](http://emberobserver.com/addons/ember-lifi) [![Code Climate](https://codeclimate.com/github/Matt-Jensen/ember-lifi/badges/gpa.svg)](https://codeclimate.com/github/Matt-Jensen/ember-lifi)

A small service for detecting internet connection

## Installation

```
ember install ember-lifi
```

## Usage

Basic

```js
import { inject as service } from '@ember/service';
import { reads } from '@ember/object/computed';

export default Component.extend({
  lifi: service(),
  isOnline: reads('lifi.isOnline')
});
```

Events

```js
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

* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

## License

This project is licensed under the [MIT License](LICENSE.md).

---
_Source: https://npm.io/package/ember-lifi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
