Closed
Description
Disallow code like
method() {
this.ngOnDestroy()
}
ngOnDestroy() { /* cleanup code here */}
Instead, we should write something like
cleanup() { /* cleanup code here */}
method() {
this.cleanup()
}
ngOnDestroy() {
this.cleanup()
}
As Rob put it, "don't call your own hooks, because one day, you'll be debugging something and you'll be really confused why hooks are firing unexpectedly/out of order/whatever".
Thought it would be a nice addition to codelyzer.
Metadata
Metadata
Assignees
Labels
No labels