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

This is RxJS v 4. Find the latest version here

Rx.Observable.prototype.subscribeOnNext(onNext, [thisArg])

Subscribes a function to invoke for each element in the observable sequence.

Arguments

  1. onNext (Function): Function to invoke for each element in the observable sequence.
  2. [thisArg] (Any): Object to use as this when executing callback.

Returns

(Disposable): The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.

Example

/* Using functions */
var source = Rx.Observable.range(0, 3)

var subscription = source.subscribeOnNext(
  function (x) {
    console.log('Next: %s', x);
  });

// => Next: 0
// => Next: 1
// => Next: 2

/* With a thisArg */
var source = Rx.Observable.range(0, 3)

var subscription = source.subscribeOnNext(
  function (x) {
    this.log('Next: %s', x);
  }, console);

// => Next: 0
// => Next: 1
// => Next: 2

Location

File:

Dist:

NPM Packages:

NuGet Packages:

Unit Tests: