Creates an Observable sequence from changes to an array using Array.observe
.
array
(Array
): The array to observe changes usingArray.observe
(Observable
): An observable sequence containing changes to an array from Array.observe
.
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}
File:
Dist:
Prerequisites:
- None
NPM Packages:
- None
NuGet Packages:
Unit Tests: