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

Commit

Permalink
Closing Issue #319
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpodwysocki committed Oct 23, 2014
1 parent 3dff8bb commit 0b442f2
Show file tree
Hide file tree
Showing 34 changed files with 1,669 additions and 775 deletions.
42 changes: 24 additions & 18 deletions dist/rx.all.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1562,14 +1562,14 @@ if (!Array.prototype.forEach) {
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }

return function (exception) {
return function (e) {
var notification = new Notification('E');
notification.exception = exception;
notification.exception = e;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
};
}());

/**
Expand All @@ -1578,17 +1578,17 @@ if (!Array.prototype.forEach) {
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {

function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }

return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());

var Enumerator = Rx.internals.Enumerator = function (next) {
Expand Down Expand Up @@ -2340,7 +2340,13 @@ if (!Array.prototype.forEach) {
if (i < len || objIsIterable) {
var result;
if (objIsIterable) {
var next = it.next();
var next;
try {
next = it.next();
} catch (e) {
observer.onError(e);
return;
}
if (next.done) {
observer.onCompleted();
return;
Expand Down Expand Up @@ -3632,7 +3638,7 @@ if (!Array.prototype.forEach) {

function concatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3659,7 +3665,7 @@ if (!Array.prototype.forEach) {
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down Expand Up @@ -3957,7 +3963,7 @@ if (!Array.prototype.forEach) {

function flatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3984,7 +3990,7 @@ if (!Array.prototype.forEach) {
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down
2 changes: 1 addition & 1 deletion dist/rx.all.compat.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/rx.all.compat.min.js

Large diffs are not rendered by default.

42 changes: 24 additions & 18 deletions dist/rx.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1411,14 +1411,14 @@
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }

return function (exception) {
return function (e) {
var notification = new Notification('E');
notification.exception = exception;
notification.exception = e;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
};
}());

/**
Expand All @@ -1427,17 +1427,17 @@
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {

function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }

return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());

var Enumerator = Rx.internals.Enumerator = function (next) {
Expand Down Expand Up @@ -2189,7 +2189,13 @@
if (i < len || objIsIterable) {
var result;
if (objIsIterable) {
var next = it.next();
var next;
try {
next = it.next();
} catch (e) {
observer.onError(e);
return;
}
if (next.done) {
observer.onCompleted();
return;
Expand Down Expand Up @@ -3481,7 +3487,7 @@

function concatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3508,7 +3514,7 @@
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down Expand Up @@ -3806,7 +3812,7 @@

function flatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3833,7 +3839,7 @@
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down
2 changes: 1 addition & 1 deletion dist/rx.all.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/rx.all.min.js

Large diffs are not rendered by default.

42 changes: 24 additions & 18 deletions dist/rx.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1562,14 +1562,14 @@ if (!Array.prototype.forEach) {
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }

return function (exception) {
return function (e) {
var notification = new Notification('E');
notification.exception = exception;
notification.exception = e;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
};
}());

/**
Expand All @@ -1578,17 +1578,17 @@ if (!Array.prototype.forEach) {
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {

function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }

return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());

var Enumerator = Rx.internals.Enumerator = function (next) {
Expand Down Expand Up @@ -2340,7 +2340,13 @@ if (!Array.prototype.forEach) {
if (i < len || objIsIterable) {
var result;
if (objIsIterable) {
var next = it.next();
var next;
try {
next = it.next();
} catch (e) {
observer.onError(e);
return;
}
if (next.done) {
observer.onCompleted();
return;
Expand Down Expand Up @@ -3632,7 +3638,7 @@ if (!Array.prototype.forEach) {

function concatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3659,7 +3665,7 @@ if (!Array.prototype.forEach) {
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down Expand Up @@ -3843,7 +3849,7 @@ if (!Array.prototype.forEach) {

function flatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3870,7 +3876,7 @@ if (!Array.prototype.forEach) {
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down
2 changes: 1 addition & 1 deletion dist/rx.compat.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/rx.compat.min.js

Large diffs are not rendered by default.

42 changes: 24 additions & 18 deletions dist/rx.js
Original file line number Diff line number Diff line change
Expand Up @@ -1411,14 +1411,14 @@
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }

return function (exception) {
return function (e) {
var notification = new Notification('E');
notification.exception = exception;
notification.exception = e;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
};
}());

/**
Expand All @@ -1427,17 +1427,17 @@
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {

function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }

return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());

var Enumerator = Rx.internals.Enumerator = function (next) {
Expand Down Expand Up @@ -2189,7 +2189,13 @@
if (i < len || objIsIterable) {
var result;
if (objIsIterable) {
var next = it.next();
var next;
try {
next = it.next();
} catch (e) {
observer.onError(e);
return;
}
if (next.done) {
observer.onCompleted();
return;
Expand Down Expand Up @@ -3481,7 +3487,7 @@

function concatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3508,7 +3514,7 @@
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down Expand Up @@ -3744,7 +3750,7 @@

function flatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
var result = selector.call(thisArg, x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(Array.isArray(result) || isIterable(result)) && (result = observableFrom(result));
return result;
Expand All @@ -3771,7 +3777,7 @@
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
if (typeof selector === 'function' && typeof resultSelector === 'function') {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
Expand Down

0 comments on commit 0b442f2

Please sign in to comment.