untilDestroy
untilDestroy copied to clipboard
do we need an npm module for this?
I'm doubting if there is a need to build an NPM module for what is essentially 1 file.
If you are interested in this, please vote in this issue.
Amazing idea! Why not a PR in Angular?
For now, I'm pretty sure this is something the core team feels this is more of a userland solution.
And also, this is completely unneeded if you go full observables and utilize the async pipe.
Most npm modules are essentially 1 file, this is usefull so please put it on npm :)
@SanderElias @cyrilletuzi I was thinking this could be part of Angular. Can the component decorator be enhanced to do:
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
unsubscribeOnDestroy: true
})
OR
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
onDestroyBehaviors: [UtilDestroy]
})
@SanderElias Amazing clean code, I love it! please do an npm pkg so I can start using already :)
Ok, I will add it as an NPM package to my sample repo.