Put in order · Angular course · Module 7: RxJS

The traditional takeUntil pattern

Arrange the steps of the traditional subscription cleanup pattern with Subject in the order they appear in a component:

Items to put in order

  • this.destroy$.complete();
  • this.destroy$.next();
  • this.data$.pipe(takeUntil(this.destroy$)).subscribe()
  • private destroy$ = new Subject<void>();

You can check the correct answer by solving this task in the CodeWorlds game.