W3cubDocs

/Angular

takeUntilDestroyed

function developer preview

Operator which completes the Observable when the calling context (component, directive, service, etc) is destroyed.

takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T>

Parameters
destroyRef DestroyRef

optionally, the DestroyRef representing the current context. This can be passed explicitly to use takeUntilDestroyed outside of an injection context. Otherwise, the current DestroyRef is injected.

Optional. Default is undefined.

Returns

MonoTypeOperatorFunction<T>

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/core/rxjs-interop/takeUntilDestroyed