{"id":16428919,"url":"https://github.com/netanelbasal/angular2-take-until-destroy","last_synced_at":"2025-03-21T04:30:59.628Z","repository":{"id":57179743,"uuid":"72990622","full_name":"NetanelBasal/angular2-take-until-destroy","owner":"NetanelBasal","description":"Declarative way to unsubscribe from observables when the component destroyed","archived":false,"fork":false,"pushed_at":"2017-11-24T07:53:42.000Z","size":28,"stargazers_count":37,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T20:45:07.169Z","etag":null,"topics":["angular2","observables","rxjs","unsubscribe"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetanelBasal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-06T12:57:32.000Z","updated_at":"2024-02-20T15:01:23.000Z","dependencies_parsed_at":"2022-09-14T03:30:50.535Z","dependency_job_id":null,"html_url":"https://github.com/NetanelBasal/angular2-take-until-destroy","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/NetanelBasal%2Fangular2-take-until-destroy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetanelBasal%2Fangular2-take-until-destroy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetanelBasal%2Fangular2-take-until-destroy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetanelBasal%2Fangular2-take-until-destroy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetanelBasal","download_url":"https://codeload.github.com/NetanelBasal/angular2-take-until-destroy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244738258,"owners_count":20501808,"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":["angular2","observables","rxjs","unsubscribe"],"created_at":"2024-10-11T08:19:43.174Z","updated_at":"2025-03-21T04:30:59.219Z","avatar_url":"https://github.com/NetanelBasal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Not maintained, use [ngx-take-until-destroy](https://github.com/NetanelBasal/ngx-take-until-destroy)\n\n# Angular 2+ - Unsubscribe for pros\n\n##### Declarative way to unsubscribe from observables when the component destroyed\n\n## Installation\n`npm install angular2-take-until-destroy --save`\n\n## Usage\n```js\nimport { TakeUntilDestroy } from \"angular2-take-until-destroy\";\n\n@Component({\n  selector: 'app-inbox',\n  templateUrl: './inbox.component.html'\n})\n@TakeUntilDestroy\nexport class InboxComponent implements OnDestroy {\n  componentDestroy;\n  constructor( ) {\n    const timer$ = Observable.interval(1000)\n      .takeUntil(this.componentDestroy())\n      .subscribe(val =\u003e console.log(val))\n  }\n\n  // If you work with AOT this method must be present, even if empty! \n  // Otherwise 'ng build --prod' will optimize away any calls to ngOnDestroy, \n  // even if the method is added by the @TakeUntilDestroy decorator\n  ngOnDestroy() {\n    // You can also do whatever you need here\n  }\n\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetanelbasal%2Fangular2-take-until-destroy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetanelbasal%2Fangular2-take-until-destroy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetanelbasal%2Fangular2-take-until-destroy/lists"}