{"id":13807152,"url":"https://github.com/ember-lifeline/ember-lifeline","last_synced_at":"2025-05-16T10:05:35.050Z","repository":{"id":12626537,"uuid":"72390599","full_name":"ember-lifeline/ember-lifeline","owner":"ember-lifeline","description":"An Ember addon for managing the lifecyle of asynchronous behavior in your objects","archived":false,"fork":false,"pushed_at":"2024-03-18T13:48:57.000Z","size":16083,"stargazers_count":239,"open_issues_count":31,"forks_count":56,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-14T21:56:32.549Z","etag":null,"topics":["ember","ember-addon","ember-lifeline","runloop"],"latest_commit_sha":null,"homepage":"https://github.com/ember-lifeline/ember-lifeline/wiki","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/ember-lifeline.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-31T02:22:08.000Z","updated_at":"2025-04-09T02:36:03.000Z","dependencies_parsed_at":"2023-02-18T03:16:27.799Z","dependency_job_id":"627358bd-3cf5-4802-9e7f-60456cdfba64","html_url":"https://github.com/ember-lifeline/ember-lifeline","commit_stats":{"total_commits":1152,"total_committers":46,"mean_commits":"25.043478260869566","dds":0.6388888888888888,"last_synced_commit":"2369dc7fa8ea0297c20d4fdcf2b7d1d789ab4497"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-lifeline%2Fember-lifeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-lifeline%2Fember-lifeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-lifeline%2Fember-lifeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-lifeline%2Fember-lifeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ember-lifeline","download_url":"https://codeload.github.com/ember-lifeline/ember-lifeline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509477,"owners_count":22082891,"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":["ember","ember-addon","ember-lifeline","runloop"],"created_at":"2024-08-04T01:01:21.699Z","updated_at":"2025-05-16T10:05:35.005Z","avatar_url":"https://github.com/ember-lifeline.png","language":"JavaScript","funding_links":[],"categories":["Packages"],"sub_categories":["Job queues"],"readme":"# ember-lifeline\n\n![CI Build](https://github.com/ember-lifeline/ember-lifeline/workflows/CI%20Build/badge.svg)\n[![Ember Observer Score](https://emberobserver.com/badges/ember-lifeline.svg)](https://emberobserver.com/addons/ember-lifeline)\n[![npm version](https://badge.fury.io/js/ember-lifeline.svg)](https://badge.fury.io/js/ember-lifeline)\n[![Monthly Downloads from NPM](https://img.shields.io/npm/dm/ember-lifeline.svg?style=flat-square)](https://www.npmjs.com/package/ember-lifeline)\n[![Code Style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](#badge)\n\nEmber applications have long life-cycles. A user may navigate to several pages\nand use many different features before they leave the application. This\nmakes JavaScript and Ember development unlike Rails development, where the\nlifecycle of a request is short and the environment disposed of after\neach request. It makes Ember development much more like iOS or video game\ndevelopment than traditional server-side web development.\n\nThis addon introduces several functional utility methods to help manage async, object\nlifecycles, and the Ember runloop. These tools should provide a simple developer\nexperience that allows engineers to focus on the business domain, and think less\nabout the weird parts of working in a long-lived app.\n\nThe [documentation wiki](https://github.com/ember-lifeline/ember-lifeline/wiki) contains more examples and API information.\n\n## Compatibility\n\n* Ember.js v3.28 or above\n* Ember CLI v3.28 or above\n* Node.js v16 or above\n\n## Installation\n\n    ember install ember-lifeline\n\n## Usage\n\nEmber Lifeline supports a functional API that enables entanglement - _the association of async behavior to object instances_. This allows you to write async code in your classes that can be automatically cleaned up for you when the object is destroyed.\n\nEmber's runloop functions, like the example below, don't ensure that an object's async is cleaned up.\n\n```js\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { run } from '@ember/runloop';\n\nexport default class Example extends Component {\n  @tracked date;\n  \n  constructor() {\n    super(...arguments);\n\n    run.later(() =\u003e {\n      this.date = new Date();\n    }, 500);\n  }\n}\n```\n\nUsing ember-lifeline's equivalent, in this case `runTask`, can help ensure that any active async is cleaned up once the object is destroyed.\n\n```js\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { runTask } from 'ember-lifeline';\n\nexport default class Example extends Component {\n  @tracked date;\n  \n  constructor() {\n    super(...arguments);\n\n    runTask(\n      this,\n      () =\u003e {\n        this.date = new Date();\n      },\n      500\n    );\n  }\n}\n```\n\nFor more information and examples, please visit the [documentation wiki](https://github.com/ember-lifeline/ember-lifeline/wiki).\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n## Credit\n\nThis addon was developed internally at Twitch, written originally by [@mixonic](https://github.com/mixonic) and [@rwjblue](https://github.com/rwjblue). It's since been further developed and maintained by [scalvert](https://github.com/scalvert).\n\nThe name `ember-lifeline` was suggested by [@nathanhammod](https://github.com/nathanhammond).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-lifeline%2Fember-lifeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fember-lifeline%2Fember-lifeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-lifeline%2Fember-lifeline/lists"}