-
Notifications
You must be signed in to change notification settings - Fork 8
repeatValue
richardszalay edited this page May 20, 2011
·
9 revisions
Repeats a value a specified number of times
static function repeatValue(value : Object, repeatCount : uint = 0,
scheduler : IScheduler = null) : IObservable.<*>
Where repeatCount is the number of times to repeat (after the initial subscription), or 0 to repeat indefinitely.
When the source sequence completes, it will be resubscribed to.
If the source sequence errors, the sequence will error and the source sequence will not be resubscribed to.
The returned sequence completes when the source sequence has been re-subscribed to repeatCount number of times and completed. If repeatCount is 0, the returned sequence never completes.
The returned sequence errors if the source sequence errors.
xs ──o─/
│ └──o─/
│ │ └──o─/
│ │ │ │
ys ──o────o────o─/
Unless specification, Scheduler.synchronous
will be used to schedule repeats
IObservable.<*>
Observable.repeatValue("raix", 1)
.subscribe(
function(x : String) : void { trace(x); },
function():void { trace("Completed"); }
);
// Trace output is:
// raix
// raix
// Completed