re: Simple state management in Angular with only Services and RxJS VIEW POST


First of all, thanks for the article.
Its really great, and certainly expanded my horizons on the use of RxJS.

Just one question, on stack blitz you use toPromise() on the calls to the rest api. This could not also be achieved using observables?

this.todosService.setCompleted(id, isCompleted)
next: value => {},
error: err => {
this.todos[index] = {
isCompleted: !isCompleted

I did see that you use it because of async/wait but not understand why.
I'm just trying to understand the difference between the two approaches.


Code of Conduct Report abuse