Home Manual Reference Source Test Repository
public class | source

PairsObservable

Extends:

Ignored → PairsObservable

We need this JSDoc comment for affecting ESDoc.

Static Method Summary

Static Public Methods
public static

create(obj: Object, scheduler: Scheduler): Observable<Array<string | T>>

Convert an object into an observable sequence of [key, value] pairs using an optional IScheduler to enumerate the object.

Static Public Methods

public static create(obj: Object, scheduler: Scheduler): Observable<Array<string | T>> source

Convert an object into an observable sequence of [key, value] pairs using an optional IScheduler to enumerate the object.

Params:

NameTypeAttributeDescription
obj Object

The object to inspect and turn into an Observable sequence.

scheduler Scheduler
  • optional

An optional IScheduler to run the enumeration of the input sequence on.

Return:

Observable<Array<string | T>>

An observable sequence of [key, value] pairs from the object.

Example:

Converts a javascript object to an Observable
var obj = {
  foo: 42,
  bar: 56,
  baz: 78
};

var source = Rx.Observable.pairs(obj);

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