1

the Angular form valueChanges observable can be used in this form:

form.valueChanges.forEach((v)=>console.log(v))

In this case, do I need to worry about unsubscribing? with forEach, there is no explicit subscribe() in my code. Is that means rx.js or angular will handle the unsubscribe?

kun
  • 3,917
  • 3
  • 15
  • 21
  • Possible duplicate of [What is the difference between Rx.Observable subscribe and forEach](https://stackoverflow.com/questions/34533197/what-is-the-difference-between-rx-observable-subscribe-and-foreach) – Julius Dzidzevičius Apr 17 '19 at 17:50

1 Answers1

0

forEach subscribes internally, and then returns a promise.

With that promise you have no way to unsubscribe.

Dmitry Grinko
  • 13,806
  • 14
  • 62
  • 86