Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.44 KB

ofarraychanges.md

File metadata and controls

52 lines (38 loc) · 1.44 KB

Rx.Observable.ofArrayChanges(array)

Creates an Observable sequence from changes to an array using Array.observe.

Arguments

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

Returns

(Observable): An observable sequence containing changes to an array from Array.observe.

Example

var arr = [1,2,3];
var source = Rx.Observable.ofArrayChanges(arr);

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

arr.push(4);

// => Next: {type: "splice", object: Array[4], index: 3, removed: Array[0], addedCount: 1}

Location

File:

Dist:

Prerequisites:

  • None

NPM Packages:

  • None

NuGet Packages:

Unit Tests: