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

Commit 73ae54d

Browse files
Fixing spawn for Observables
1 parent 0b66ec3 commit 73ae54d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+111
-65
lines changed

dist/rx.all.compat.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@
21522152
* @param {Any} An object to determine whether it is an Observable
21532153
* @returns {Boolean} true if an Observable, else false.
21542154
*/
2155-
observableProto.isObservable = function (o) {
2155+
Observable.isObservable = function (o) {
21562156
return o && isFunction(o.subscribe);
21572157
}
21582158

@@ -6321,10 +6321,11 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
63216321
function toObservable(obj) {
63226322
if (!obj) { return obj; }
63236323
if (Observable.isObservable(obj)) { return obj; }
6324-
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
63256324
if (isPromise(obj)) { return Observable.fromPromise(obj); }
63266325
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
63276326
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
6327+
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
6328+
if (isObject(obj)) return objectToObservable.call(this, obj);
63286329
return obj;
63296330
}
63306331

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

6389+
function isObject(val) {
6390+
return Object == val.constructor;
6391+
}
6392+
63886393
/**
63896394
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
63906395
*

dist/rx.all.compat.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.compat.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@
19611961
* @param {Any} An object to determine whether it is an Observable
19621962
* @returns {Boolean} true if an Observable, else false.
19631963
*/
1964-
observableProto.isObservable = function (o) {
1964+
Observable.isObservable = function (o) {
19651965
return o && isFunction(o.subscribe);
19661966
}
19671967

@@ -6219,10 +6219,11 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA
62196219
function toObservable(obj) {
62206220
if (!obj) { return obj; }
62216221
if (Observable.isObservable(obj)) { return obj; }
6222-
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
62236222
if (isPromise(obj)) { return Observable.fromPromise(obj); }
62246223
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
62256224
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
6225+
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
6226+
if (isObject(obj)) return objectToObservable.call(this, obj);
62266227
return obj;
62276228
}
62286229

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

6287+
function isObject(val) {
6288+
return Object == val.constructor;
6289+
}
6290+
62866291
/**
62876292
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
62886293
*

dist/rx.all.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.async.compat.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@
110110
function toObservable(obj) {
111111
if (!obj) { return obj; }
112112
if (Observable.isObservable(obj)) { return obj; }
113-
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
114113
if (isPromise(obj)) { return Observable.fromPromise(obj); }
115114
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
116115
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
116+
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
117+
if (isObject(obj)) return objectToObservable.call(this, obj);
117118
return obj;
118119
}
119120

@@ -174,6 +175,10 @@
174175
return isGenerator(ctor.prototype);
175176
}
176177

178+
function isObject(val) {
179+
return Object == val.constructor;
180+
}
181+
177182
/**
178183
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
179184
*

dist/rx.async.compat.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.async.compat.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.async.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@
110110
function toObservable(obj) {
111111
if (!obj) { return obj; }
112112
if (Observable.isObservable(obj)) { return obj; }
113-
if (isArrayLike(result) || isIterable(result)) { return arrayToObservable.call(this, obj); }
114113
if (isPromise(obj)) { return Observable.fromPromise(obj); }
115114
if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); }
116115
if (isFunction(obj)) { return thunkToObservable.call(this, obj); }
116+
if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); }
117+
if (isObject(obj)) return objectToObservable.call(this, obj);
117118
return obj;
118119
}
119120

@@ -174,6 +175,10 @@
174175
return isGenerator(ctor.prototype);
175176
}
176177

178+
function isObject(val) {
179+
return Object == val.constructor;
180+
}
181+
177182
/**
178183
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
179184
*

0 commit comments

Comments
 (0)