2.0.3 • Published 6 years ago

@abcum/ember-internet v2.0.3

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

ember-internet

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

npm.io npm.io npm.io npm.io npm.io npm.io

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 propertyExample output
internet.statusonline
internet.onlinetrue
internet.offlinefalse

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)
2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

7 years ago