take
Emits only the first count values emitted by the source Observable.
Parameters
| count |
The maximum number of |
Returns
MonoTypeOperatorFunction<T>: An Observable that emits only the first count
values emitted by the source Observable, or all of the values from the source
if the source emits fewer than count values.
Throws
ArgumentOutOfRangeError When using take(i), it delivers an
ArgumentOutOrRangeError to the Observer's error callback if i < 0.
Description
Takes the first count values from the source, then
completes.

take returns an Observable that emits only the first count values emitted
by the source Observable. If the source emits fewer than count values then
all of its values are emitted. After that, it completes, regardless if the
source completes.
Example
Take the first 5 seconds of an infinite 1-second interval Observable