Rule proposal: No Async Lifecycles #1078
Closed
DavidANeil
started this conversation in
New Rule Proposals
Replies: 1 comment
-
related issue #1515
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Lifecycle methods (e.g.
ngOnInit
,ngOnDestroy
) are called synchronously by Angular, so async methods (or really any return value) is ignored.It would be nice to be able to enforce that these methods are not
async
, or more generally that they do not return aPromise
, or potentially even any return value could be considered an error.This would help catch issues that can arise in testing components where the
ngOnDestroy
is called during cleanup, but the asynchronous tasks it spawns might execute during a different test.Beta Was this translation helpful? Give feedback.
All reactions