xgrommx / rx-book

xgrommx.github.io/rx-book
1.66k stars 184 forks source link

Rx.AsyncSubject() Example error #39

Closed xuelink closed 8 years ago

xuelink commented 8 years ago

AsyncSubject Constructor

in the example source should be subject

var subject = new Rx.AsyncSubject();

subject.onNext(42);
subject.onCompleted();

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

// => 42
// => Completed
xgrommx commented 8 years ago

@behicsakar welcome to PR