This package has been deprecated

Author message:

Package no longer supported. Use github.com/abcum/ascua instead.

@abcum/ember-internet

2.0.3 • Public • Published

ember-internet

A utility for working with connection status in an Ember.js app.

Usage

Installation

ember install @abcum/ember-internet

Introduction

The ember-internet addon enables responding to changes to the internet connection status. This enables customisation of notifications, behaviour, and styling depending on the current internet connection status.

The full connection status object is made available inside all routes, controllers, and components.

Examples

Displaying the current status.

{{internet.status}}

Using the current route info inside an Ember controller.

export default Ember.Controller.extend({
	status: Ember.observer('internet.status', function() {
		// Do something with the current connection status
		alert(`You are now ${internet.status}.`);
	})
})

Using the current route info inside handlebars templates.

<button class="{{if internet.offline 'disabled'}}">
  Save
</button>

Properties

The following properties are available.

Object property Example output
internet.status online
internet.online true
internet.offline false

Development

  • make install (install bower and ember-cli dependencies)
  • make upgrade (upgrade ember-cli to the specified version)
  • make tests (run all tests defined in the package)

Readme

Keywords

Package Sidebar

Install

npm i @abcum/ember-internet

Weekly Downloads

0

Version

2.0.3

License

MIT

Unpacked Size

8.21 kB

Total Files

13

Last publish

Collaborators

  • tobiemh