-
Notifications
You must be signed in to change notification settings - Fork 8
startWith
richardszalay edited this page May 20, 2011
·
10 revisions
Emits the specified values at the start of a sequence
function startWith(values : *,
scheduler : IScheduler = null) : IObservable.<T>
Where values is a value that can be converted to an IObservable using toObservable.
The returned sequence completes when the source sequence completes.
The returned sequence raises an error if the source sequence raises an error.
values ─o──o──/
│ │ │
source │ │ └─o──o──o───/
│ │ │ │ │ │
zs ─o──o────o──o──o───/
Unless specified, this operator uses Scheduler.defaultScheduler
to schedule each element in values.
IObservable.<T>
Observable.range(1, 3).startWith([500, 501])
.subscribe(
function(value : int) : void { trace(value); },
function():void { trace("Completed"); }
);
// Trace output is:
// 500
// 501
// 1
// 2
// 3
// Completed