From 8c50cdb7d9e63463affe2f13d9db144ed85a5b83 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 22 Jul 2020 22:54:58 +0300 Subject: [PATCH] chore(core): deprecate the takeUntilDestroy #4818 --- npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts index ef6a75fe65..7e77bddba5 100644 --- a/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts +++ b/npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts @@ -1,3 +1,4 @@ +// tslint:disable: max-line-length import { Observable, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; @@ -5,13 +6,16 @@ function isFunction(value) { return typeof value === 'function'; } +/** + * @deprecated no longer working, please use SubscriptionService (https://docs.abp.io/en/abp/latest/UI/Angular/Subscription-Service) instead. + */ export const takeUntilDestroy = (componentInstance, destroyMethodName = 'ngOnDestroy') => ( - source: Observable + source: Observable, ) => { const originalDestroy = componentInstance[destroyMethodName]; if (isFunction(originalDestroy) === false) { throw new Error( - `${componentInstance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}` + `${componentInstance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}`, ); } if (!componentInstance['__takeUntilDestroy']) {