Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Latest commit

 

History

History
62 lines (49 loc) · 2.11 KB

startwith.md

File metadata and controls

62 lines (49 loc) · 2.11 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: