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

Latest commit

 

History

History
52 lines (38 loc) · 1.43 KB

ofobjectchanges.md

File metadata and controls

52 lines (38 loc) · 1.43 KB

Rx.Observable.ofObjectChanges(obj)

Creates an Observable sequence from changes to an object using Object.observe.

Arguments

  1. array (Array): The object to observe changes using Object.observe

Returns

(Observable): An observable sequence containing changes to an object from Object.observe.

Example

var obj = {x: 1};
var source = Rx.Observable.ofObjectChanges(obj);

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

obj.x = 42;

// => Next: {type: "update", object: Object, name: "x", oldValue: 1}

Location

File:

Dist:

Prerequisites:

  • None

NPM Packages:

  • None

NuGet Packages:

Unit Tests: