• Overview
@angular/core/rxjs-interop

takeUntilDestroyed

function

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

  
    function takeUntilDestroyed<T>(  destroyRef?: DestroyRef | undefined): MonoTypeOperatorFunction<T>;
  
  

takeUntilDestroyed

MonoTypeOperatorFunction<T>

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

@paramdestroyRefDestroyRef | undefined

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.

@returnsMonoTypeOperatorFunction<T>
Jump to details