You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
addTodo(newTodo:Todo):Observable {
let obs = this.todoBackendService.saveTodo(newTodo);
obs.subscribe(
res => {
this._todos.next(this._todos.getValue().push(newTodo));
});
return obs;
}
obs would get called twice, since there are two subscribers (inner and outer of addTodo method), may have to change it to let obs = this.todoBackendService.saveTodo(newTodo).share();
The text was updated successfully, but these errors were encountered:
obs would get called twice, since there are two subscribers (inner and outer of addTodo method), may have to change it to
let obs = this.todoBackendService.saveTodo(newTodo).share();
The text was updated successfully, but these errors were encountered: