2

Angular cancels a $http call when the timeout promise gets resolved or when the timeout if passed as integer exceeds the specified time.

I created an implementation in my projects that cancels pending requests when the user navigates between pages which means that all requests have their own promises passed as timeout.

Because I'm concerned with memory leaks I want to ensure that all objects are GC so my question is:

When the requests succeeds what happens to the timeout promise? Is it garbage collected or shall I do something to prepare it for garbage collection such as resolving it?

NOTE: I'm assuming resolving the promise would do the trick but i'm not even sure about that

Lothre1
  • 3,523
  • 7
  • 43
  • 64

0 Answers0