elementAt
Emits the single value at the specified index
in a sequence of emissions
from the source Observable.
Parameters
Returns
MonoTypeOperatorFunction<T>
: An Observable that emits a single item, if it is found.
Otherwise, will emit the default value if given. If not, then emits an error.
Throws
ArgumentOutOfRangeError
When using elementAt(i)
, it delivers an
ArgumentOutOrRangeError to the Observer's error
callback if i < 0
or the
Observable has completed before emitting the i-th next
notification.
Description
Emits only the i-th value, then completes.
elementAt
returns an Observable that emits the item at the specified
index
in the source Observable, or a default value if that index
is out
of range and the default
argument is provided. If the default
argument is
not given and the index
is out of range, the output Observable will emit an
ArgumentOutOfRangeError
error.
Example
Emit only the third click event