{"id":15022873,"url":"https://github.com/srowhani/ember-connection-status","last_synced_at":"2025-10-24T20:32:10.398Z","repository":{"id":43144967,"uuid":"64035377","full_name":"srowhani/ember-connection-status","owner":"srowhani","description":"Hooks for loss and gain of connectivity for Ember.js","archived":false,"fork":false,"pushed_at":"2016-07-31T15:11:46.000Z","size":2589,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T04:25:24.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srowhani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-23T20:42:20.000Z","updated_at":"2018-03-29T11:17:15.000Z","dependencies_parsed_at":"2022-08-30T02:10:14.422Z","dependency_job_id":null,"html_url":"https://github.com/srowhani/ember-connection-status","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srowhani%2Fember-connection-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srowhani%2Fember-connection-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srowhani%2Fember-connection-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srowhani%2Fember-connection-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srowhani","download_url":"https://codeload.github.com/srowhani/ember-connection-status/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238035385,"owners_count":19405682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:58:28.672Z","updated_at":"2025-10-24T20:32:08.996Z","avatar_url":"https://github.com/srowhani.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember-connection-status\n\n[Demo](http://srowhani.github.io/ember-connection-status)\n\nConvenience tool I threw together from this [gist](https://gist.github.com/lukes/e190d5db75204bc1ca64)\n\n## Instructions\n\n- `ember install ember-connection-status`\n- In either a controller, route, or component add the following:\n\nHere's the application route as an example.\n```js\nimport Ember from 'ember';\n\nexport default Ember.Route.extend({\n  connectionStatus: Ember.inject.service(),\n  init () {\n    this._super(...arguments)\n    let connection = this.get('connectionStatus')\n    //pass this instance to connectionStatus service.\n    //allows for action hooks to fire here.\n    connection.setup(this)\n  },\n  status: Ember.computed('connectionStatus.online', function () {\n    return this.get('connectionStatus.online')\n      ? 'Online' : 'Offline'\n  }),\n  actions: {\n    online (event) {\n      this.notifications.success(event.type, {\n        autoClear: true,\n        clearDuration: 1000\n      });\n    },\n    offline (event) {\n      this.notifications.error(event.type, {\n        autoClear: true,\n        clearDuration: 1000\n      });\n    }\n  }\n});\n```\n\nYou can also access the network status via the `connection.online` property.\nIf you choose you can observe changes, or create a computed property based on it.\n\n## Installation\n\n* `git clone` this repository\n* `npm install`\n* `bower install`\n\n## Try it yourself\n\nClone the repo, go through the installation process, and serve it up.\n\n* `ember server`\n* Visit your app at http://localhost:4200.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrowhani%2Fember-connection-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrowhani%2Fember-connection-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrowhani%2Fember-connection-status/lists"}