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

Commit

Permalink
Fixing spawn for Observables
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpodwysocki committed Aug 3, 2015
1 parent 0b66ec3 commit 73ae54d
Show file tree
Hide file tree
Showing 42 changed files with 111 additions and 65 deletions.
9 changes: 7 additions & 2 deletions dist/rx.all.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,7 @@
* @param {Any} An object to determine whether it is an Observable
* @returns {Boolean} true if an Observable, else false.
*/
observableProto.isObservable = function (o) {
Observable.isObservable = function (o) {
return o && isFunction(o.subscribe);
}

Expand Down Expand Up @@ -6321,10 +6321,11 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
function toObservable(obj) {
if (!obj) { return obj; }
if (Observable.isObservable(obj)) { return obj; }
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
if (isPromise(obj)) { return Observable.fromPromise(obj); }
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
if (isObject(obj)) return objectToObservable.call(this, obj);
return obj;
}

Expand Down Expand Up @@ -6385,6 +6386,10 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
return isGenerator(ctor.prototype);
}

function isObject(val) {
return Object == val.constructor;
}

/**
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
*
Expand Down
2 changes: 1 addition & 1 deletion dist/rx.all.compat.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions dist/rx.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@
* @param {Any} An object to determine whether it is an Observable
* @returns {Boolean} true if an Observable, else false.
*/
observableProto.isObservable = function (o) {
Observable.isObservable = function (o) {
return o && isFunction(o.subscribe);
}

Expand Down Expand Up @@ -6219,10 +6219,11 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
function toObservable(obj) {
if (!obj) { return obj; }
if (Observable.isObservable(obj)) { return obj; }
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
if (isPromise(obj)) { return Observable.fromPromise(obj); }
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
if (isObject(obj)) return objectToObservable.call(this, obj);
return obj;
}

Expand Down Expand Up @@ -6283,6 +6284,10 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
return isGenerator(ctor.prototype);
}

function isObject(val) {
return Object == val.constructor;
}

/**
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
*
Expand Down
2 changes: 1 addition & 1 deletion dist/rx.all.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/rx.all.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion dist/rx.async.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@
function toObservable(obj) {
if (!obj) { return obj; }
if (Observable.isObservable(obj)) { return obj; }
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
if (isPromise(obj)) { return Observable.fromPromise(obj); }
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
if (isObject(obj)) return objectToObservable.call(this, obj);
return obj;
}

Expand Down Expand Up @@ -174,6 +175,10 @@
return isGenerator(ctor.prototype);
}

function isObject(val) {
return Object == val.constructor;
}

/**
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
*
Expand Down
2 changes: 1 addition & 1 deletion dist/rx.async.compat.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rx.async.compat.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion dist/rx.async.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@
function toObservable(obj) {
if (!obj) { return obj; }
if (Observable.isObservable(obj)) { return obj; }
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
if (isPromise(obj)) { return Observable.fromPromise(obj); }
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
if (isObject(obj)) return objectToObservable.call(this, obj);
return obj;
}

Expand Down Expand Up @@ -174,6 +175,10 @@
return isGenerator(ctor.prototype);
}

function isObject(val) {
return Object == val.constructor;
}

/**
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
*
Expand Down
Loading

0 comments on commit 73ae54d

Please sign in to comment.