I'm feeling a bit lost and hoping someone could assist me in comprehending the use of .subscribe in Angular 2 RxJS.
If I have a webpage with a button to submit form data, do I need to subscribe to post information or should I opt for using a promise?
As far as I understand it, when you subscribe and then click the button again, you'll end up with multiple subscriptions. I know one solution is to kill the subscription during destruction, but that's not what I'm asking about.
My question is, if the form persists until hitting the home button and clearing upon submission to enter more data, should I go for Promise instead of Subscribe? Subscribe seems to act like a newsletter - the more you subscribe, the more newsletters you receive.
So, what is the better approach for repeatedly submitting data without creating multiple subscriptions?
myObsFunc(dataToSend).subscribe(err => console.log(err), () => console.log(success));
or
myObsFunc(dataToSend).toPromise().then().catch(e => console.log(e));