question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drop UntilDestroy decorator

See original GitHub issue

In the latest Angular version, we can achieve the same functionality by using only the untilDestroy operator. We’ll drop support for Pipes for now.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bbarrycommented, Aug 25, 2020

@VamsiDharmaji, @NetanelBasal I can confirm the above code does not seem to work. It runs the componentInstance[destroyMethodName] = function () assignment but the method is never called. According to the PR https://github.com/angular/angular/pull/35464 you can modify the lifecycle hooks any time before initialization but nothing after the initialization is certain to run.

The decorator can probably be cleaned up a little and maybe some changes can be done to make it easier to share the attribute from a base class but I think this issue should probably be wontfixed sadly.

0reactions
NetanelBasalcommented, Oct 17, 2020

I’m closing the issue for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Drop UntilDestroy decorator - - Bountysource
Drop UntilDestroy decorator ... In the latest Angular version, we can achieve the same functionality by using only the untilDestroy operator. We'll drop...
Read more >
@ngneat/until-destroy | Yarn - Package Manager
The order of decorators is important, make sure to put @UntilDestroy() before the @Component() decorator. When using overrideComponent in unit tests remember ...
Read more >
Auto-Unsubscribing in Angular Components Like a Pro
This solution incorporates the principles similar to the ones of the @AutoUnsubscribe decorator, along with a new feature — the untilDestroyed ...
Read more >
How to add a method on ngOnDestroy in angular decorator ...
I have already tried to add a ngOnDestroy on my code in decorator but it overrides the classes ngOnDestroy. constructor.prototype.
Read more >
Angular Take Until Destroy Decorator - StackBlitz
take-until-destroy.decorator';. import { Observable, interval } from 'rxjs';. import { takeUntil } from 'rxjs/operators';. @Component({. selector: 'hello',.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found