In rxjs what exactly does the observer.complete() do after observer.next() ?
From the documentation observer.complete notifies the Observer that the Observable has finished sending push-based notifications.
In the other hand, observer.complete it's a callback function and an Observable calls this method after it has called next() for the final time, if it has not encountered any errors.
In ReactiveX library, there are two types of messages.
First ones are ordinary messages. Ordinary messages are the ones sent with .next() and there can be 0-many of them.
Second type are notifications. These can be of two types - error and success. The error is sent with .error() and give some error details in it (like exception) and success is sent with .complete() meaning that there will intentionally be no messages. Every observable should end with a single error or a single success notification.
来源:https://stackoverflow.com/questions/48278920/what-does-observer-complete-do