"subscribe is deprecated: use an observer instead of an error callback" Code Answer

3

subscribe isn't deprecated, only the variant you're using is deprecated. in the future, subscribe will only take one argument: either the next handler (a function) or an observer object.

so in your case you should use:

.subscribe({
   next: this.handleupdateresponse.bind(this),
   error: this.handleerror.bind(this)
});

see these github issues:

  • https://github.com/reactivex/rxjs/pull/4202

  • https://github.com/reactivex/rxjs/issues/4159

By fisherwebdev on June 23 2022

Answers related to “subscribe is deprecated: use an observer instead of an error callback”

Only authorized users can answer the Search term. Please sign in first, or register a free account.