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

Reactive Extensions for JavaScript (RxJS) version 2.2.9

Compare
Choose a tag to compare
@mattpodwysocki mattpodwysocki released this 27 Nov 22:26
· 2058 commits to master since this release

Slight update to 2.2.7 to include shortcut operators for adding a reference counter for all connectable observables, by calling refCount. Adding the share(), shareValue(), and shareReplay() methods. These methods are optimized for the 80% case, in which the developer simply wants to share side effects among multiple concurrent observer. This allows developers simple code like this:

var interval = Rx.Observable.interval(1000);

var source = interval
    .take(2)
    .do(function (x) {  console.log('Side effect'); })
    .share();

// When the number of observers subscribed to published observable goes from 
// 0 to 1, we connect to the underlying observable sequence.
source.subscribe(createObserver('SourceA'));

// When the second subscriber is added, no additional subscriptions are added to the
// underlying observable sequence. As a result the operations that result in side 
// effects are not repeated per subscriber.
source.subscribe(createObserver('SourceB'));

function createObserver(tag) {
    return Rx.Observer.create(
        function (x) {
            console.log('Next: ' + tag + x);
        },
        function (err) {
            console.log('Error: ' + err);
        },
        function () {
            console.log('Completed');
        }
    );
}

Other changes:

  • Fixed Bower version issue
  • Added SauceLabs testing