This repository has been archived by the owner. It is now read-only.
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (49 sloc) 2.11 KB

This is RxJS v 4. Find the latest version here

Rx.Observable.prototype.startWith([scheduler] ...args)

Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.

Arguments

  1. [scheduler] (Scheduler): Scheduler to execute the function.
  2. args (arguments): Values to prepend to the observable sequence.

Returns

(Observable): The source sequence prepended with the specified values.

Example

var source = Rx.Observable.return(4)
    .startWith(1, 2, 3)

var subscription = source.subscribe(
    function (x) {
        console.log('Next: ' + x);
    },
    function (err) {
        console.log('Error: ' + err);
    },
    function () {
        console.log('Completed');
    });

// => Next: 1
// => Next: 2
// => Next: 3
// => Next: 4
// => Completed

Location

File:

Dist:

Prerequisites:

  • None

NPM Packages:

NuGet Packages:

Unit Tests: