Implements the Observer interface and extends the
Subscription class. While the Observer is the public API for
consuming the values of an Observable, all Observers get converted to
a Subscriber, in order to provide Subscription-like capabilities such as
unsubscribe. Subscriber is a common type in RxJS, and crucial for
implementing operators, but it is rarely used as a public API.
A partially
defined Observer or a next callback function.
error
Optional. Default is undefined.
The error callback of an
Observer.
complete
Optional. Default is undefined.
The complete callback of an
Observer.
Properties
Property
Type
Description
isStopped
destination
Methods
next()
The Observer callback to receive notifications of type next from
the Observable, with a value. The Observable may call this method 0 or more
times.
next(value?: T): void
Parameters
value
Optional. Default is undefined.
The next value.
Returns
void:
error()
The Observer callback to receive notifications of type error from
the Observable, with an attached Error. Notifies the Observer that
the Observable has experienced an error condition.
error(err?: any): void
Parameters
err
Optional. Default is undefined.
The error exception.
Returns
void:
complete()
The Observer callback to receive a valueless notification of type
complete from the Observable. Notifies the Observer that the Observable
has finished sending push-based notifications.