Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 2.02 KB

startwith.md

File metadata and controls

61 lines (48 loc) · 2.02 KB

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: