0
httpResp.subscribe({
 next: this.someMethod.bind(this)
})

Sonar ("Deprecated APIs should not be used" rule) flags the use of subscribe with: "subscribe is deprecated: Use an observer instead of a complete callback"

This is in regards with the RXJS6 changes where the use of subscribe(callback) is considered deprecated. I've changed the call as stated here https://stackoverflow.com/a/55472361 but I still get the line flagged. Does anyone know why?

  • And what is your question? – JB Nizet Aug 02 '19 at 11:40
  • I've updated the post – Sergiu Lucutar Aug 02 '19 at 11:45
  • Asking around about this, I was told this: `This is because of how IDEs show docs of overloaded methods. There are four overloads of subscribe() and the three of them have a deprecation warning, so the IDE shows all of them (even if they are not applicable to the used signature. See the source code here: https://github.com/ReactiveX/rxjs/blob/c44734755d220ea50412a1486d7bd100a7694aef/src/internal/Observable.ts#L73-L79 (Actually, it's not the IDE; it is probably the TypeScript server's doing - but the result is the same :grin:) – DeborahK Aug 02 '19 at 23:37

0 Answers0