repeat
Returns an Observable that will resubscribe to the source stream when the source stream completes, at most count times.
Parameters
count |
Optional. Default is The number of times the source Observable items are repeated, a count of 0 will yield an empty Observable. |
Returns
MonoTypeOperatorFunction<T>
: An Observable that will resubscribe to the source stream when the source stream completes
, at most count times.
Description
Repeats all values emitted on the source. It's like retry
, but for non error cases.
Similar to retry
, this operator repeats the stream of items emitted by the source for non error cases.
Repeat can be useful for creating observables that are meant to have some repeated pattern or rhythm.
Note: repeat(0)
returns an empty observable and repeat()
will repeat forever
Example
Repeat a message stream
Repeat 3 values, 2 times