\r\n\r\n","import { Injectable, OnDestroy } from '@angular/core';\r\nimport { SubSink } from './sub-sink';\r\n\r\n/**\r\n * A class that automatically unsubscribes all observables when the object gets destroyed\r\n */\r\n@Injectable()\r\nexport class UnsubscribeOnDestroyAdapter implements OnDestroy {\r\n /**\r\n * The subscription sink object that stores all subscriptions\r\n */\r\n subs = new SubSink();\r\n\r\n /**\r\n * The lifecycle hook that unsubscribes all subscriptions when the component / object gets destroyed\r\n */\r\n ngOnDestroy(): void {\r\n this.subs.unsubscribe();\r\n }\r\n}\r\n","