Observer<T> constructor
Observer<T> ({
- NextCallback<
T> ? next, - ErrorCallback? error,
- CompleteCallback? complete,
- bool ignoreErrors = false,
An observer with custom handlers:
next
is a callback that is called zero or more times with values of typeT
.error
is a callback that is called when the observer terminates with an exception and an optional stack trace. If you do not provide an this callback the error is passed to the defaultErrorHandler, unlessignoreErrors
is set totrue
.complete
is a callback that is called when the observer successfully terminates.
Implementation
factory Observer({
NextCallback<T>? next,
ErrorCallback? error,
CompleteCallback? complete,
bool ignoreErrors = false,
}) =>
BaseObserver<T>(
next ?? emptyFunction1,
error ?? (ignoreErrors ? emptyFunction2 : defaultErrorHandler),
complete ?? emptyFunction0);