rxjs-rails 2.2.15 → 2.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rxjs/rails/version.rb +1 -1
- data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.min.js +1 -1
- data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
- data/vendor/assets/javascripts/rx.binding.min.js +1 -1
- data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
- data/vendor/assets/javascripts/rx.compat.js +186 -184
- data/vendor/assets/javascripts/rx.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.experimental.js +50 -42
- data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
- data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
- data/vendor/assets/javascripts/rx.js +186 -184
- data/vendor/assets/javascripts/rx.lite.compat.js +186 -184
- data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.lite.js +185 -183
- data/vendor/assets/javascripts/rx.lite.min.js +2 -2
- data/vendor/assets/javascripts/rx.min.js +2 -2
- data/vendor/assets/javascripts/rx.testing.min.js +1 -1
- data/vendor/assets/javascripts/rx.time.min.js +1 -1
- data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
- metadata +2 -2
@@ -33,48 +33,56 @@
|
|
33
33
|
}
|
34
34
|
}.call(this, function (root, exp, Rx, undefined) {
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
36
|
+
// Aliases
|
37
|
+
var Observable = Rx.Observable,
|
38
|
+
observableProto = Observable.prototype,
|
39
|
+
AnonymousObservable = Rx.AnonymousObservable,
|
40
|
+
observableConcat = Observable.concat,
|
41
|
+
observableDefer = Observable.defer,
|
42
|
+
observableEmpty = Observable.empty,
|
43
|
+
disposableEmpty = Rx.Disposable.empty,
|
44
|
+
CompositeDisposable = Rx.CompositeDisposable,
|
45
|
+
SerialDisposable = Rx.SerialDisposable,
|
46
|
+
SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
|
47
|
+
Enumerator = Rx.internals.Enumerator,
|
48
|
+
Enumerable = Rx.internals.Enumerable,
|
49
|
+
enumerableForEach = Enumerable.forEach,
|
50
|
+
immediateScheduler = Rx.Scheduler.immediate,
|
51
|
+
currentThreadScheduler = Rx.Scheduler.currentThread,
|
52
|
+
slice = Array.prototype.slice,
|
53
|
+
AsyncSubject = Rx.AsyncSubject,
|
54
|
+
Observer = Rx.Observer,
|
55
|
+
inherits = Rx.internals.inherits,
|
56
|
+
addProperties = Rx.internals.addProperties;
|
57
|
+
|
58
|
+
// Utilities
|
59
|
+
function nothing () { }
|
60
|
+
function argsOrArray(args, idx) {
|
61
|
+
return args.length === 1 && Array.isArray(args[idx]) ?
|
62
|
+
args[idx] :
|
63
|
+
slice.call(args);
|
64
|
+
}
|
65
|
+
|
66
|
+
// Shim in iterator support
|
67
|
+
var $iterator$ = (typeof Symbol === 'object' && Symbol.iterator) ||
|
68
|
+
'_es6shim_iterator_';
|
69
|
+
// Firefox ships a partial implementation using the name @@iterator.
|
70
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14
|
71
|
+
// So use that name if we detect it.
|
72
|
+
if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
|
73
|
+
$iterator$ = '@@iterator';
|
74
|
+
}
|
75
|
+
var doneEnumerator = { done: true, value: undefined };
|
76
|
+
|
77
|
+
function enumerableWhile(condition, source) {
|
78
|
+
return new Enumerable(function () {
|
79
|
+
return new Enumerator(function () {
|
80
|
+
return condition() ?
|
81
|
+
{ done: false, value: source } :
|
82
|
+
{ done: true, value: undefined };
|
83
|
+
});
|
84
|
+
});
|
85
|
+
}
|
78
86
|
|
79
87
|
/**
|
80
88
|
* Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
|
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(t){var e={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=e[typeof window]&&window||this,r=e[typeof exports]&&exports&&!exports.nodeType&&exports,o=e[typeof module]&&module&&!module.nodeType&&module,i=(o&&o.exports===r&&r,e[typeof global]&&global);!i||i.global!==i&&i.window!==i||(n=i),"function"==typeof define&&define.amd?define(["rx","exports"],function(e,r){return n.Rx=t(n,r,e),n.Rx}):"object"==typeof module&&module&&module.exports===r?module.exports=t(n,module.exports,require("./rx")):n.Rx=t(n,{},n.Rx)}).call(this,function(t,e,n,r){function o(){}function i(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:E.call(t)}function s(t,e){return new y(function(){return new m(function(){return t()?{done:!1,value:e}:{done:!0,value:r}})})}var u=n.Observable,c=u.prototype,a=n.AnonymousObservable,l=u.concat,f=u.defer,h=u.empty,p=n.Disposable.empty,d=n.CompositeDisposable,b=n.SerialDisposable,v=n.SingleAssignmentDisposable,m=n.internals.Enumerator,y=n.internals.Enumerable,w=y.forEach,g=n.Scheduler.immediate,x=n.Scheduler.currentThread,E=Array.prototype.slice,C=n.AsyncSubject,D=n.Observer,S=n.internals.inherits,A=n.internals.addProperties,N="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";t.Set&&"function"==typeof(new t.Set)["@@iterator"]&&(N="@@iterator"),c.letBind=c.let=function(t){return t(this)},u["if"]=u.ifThen=function(t,e,n){return f(function(){if(n||(n=h()),n.now){var r=n;n=h(r)}return t()?e:n})},u["for"]=u.forIn=function(t,e){return w(t,e).concat()};var _=u["while"]=u.whileDo=function(t,e){return s(t,e).concat()};c.doWhile=function(t){return l([this,_(t,this)])},u["case"]=u.switchCase=function(t,e,n){return f(function(){if(n||(n=h()),n.now){var o=n;n=h(o)}var i=e[t()];return i!==r?i:n})},c.expand=function(t,e){e||(e=g);var n=this;return new a(function(o){var i=[],s=new b,u=new d(s),c=0,a=!1,l=function(){var n=!1;i.length>0&&(n=!a,a=!0),n&&s.setDisposable(e.scheduleRecursive(function(e){var n;if(!(i.length>0))return a=!1,r;n=i.shift();var s=new v;u.add(s),s.setDisposable(n.subscribe(function(e){o.onNext(e);var n=null;try{n=t(e)}catch(r){o.onError(r)}i.push(n),c++,l()},o.onError.bind(o),function(){u.remove(s),c--,0===c&&o.onCompleted()})),e()}))};return i.push(n),c++,l(),u})},u.forkJoin=function(){var t=i(arguments,0);return new a(function(e){var n=t.length;if(0===n)return e.onCompleted(),p;for(var o=new d,i=!1,s=Array(n),u=Array(n),c=Array(n),a=0;n>a;a++)(function(a){var l=t[a];o.add(l.subscribe(function(t){i||(s[a]=!0,c[a]=t)},function(t){i=!0,e.onError(t),o.dispose()},function(){if(!i){if(!s[a])return e.onCompleted(),r;u[a]=!0;for(var t=0;n>t;t++)if(!u[t])return;i=!0,e.onNext(c),e.onCompleted()}}))})(a);return o})},c.forkJoin=function(t,e){var n=this;return new a(function(o){var i,s,u=!1,c=!1,a=!1,l=!1,f=new v,h=new v;return f.setDisposable(n.subscribe(function(t){a=!0,i=t},function(t){h.dispose(),o.onError(t)},function(){if(u=!0,c)if(a)if(l){var t;try{t=e(i,s)}catch(n){return o.onError(n),r}o.onNext(t),o.onCompleted()}else o.onCompleted();else o.onCompleted()})),h.setDisposable(t.subscribe(function(t){l=!0,s=t},function(t){f.dispose(),o.onError(t)},function(){if(c=!0,u)if(a)if(l){var t;try{t=e(i,s)}catch(n){return o.onError(n),r}o.onNext(t),o.onCompleted()}else o.onCompleted();else o.onCompleted()})),new d(f,h)})},c.manySelect=function(t,e){e||(e=g);var n=this;return f(function(){var r;return n.select(function(t){var e=new O(t);return r&&r.onNext(t),r=e,e}).doAction(o,function(t){r&&r.onError(t)},function(){r&&r.onCompleted()}).observeOn(e).select(function(e,n,r){return t(e,n,r)})})};var O=function(t){function e(t){var e=this,n=new d;return n.add(x.schedule(function(){t.onNext(e.head),n.add(e.tail.mergeObservable().subscribe(t))})),n}function n(n){t.call(this,e),this.head=n,this.tail=new C}return S(n,t),A(n.prototype,D,{onCompleted:function(){this.onNext(u.empty())},onError:function(t){this.onNext(u.throwException(t))},onNext:function(t){this.tail.onNext(t),this.tail.onCompleted()}}),n}(u);return n});
|
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(t){var e={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=e[typeof window]&&window||this,r=e[typeof exports]&&exports&&!exports.nodeType&&exports,o=e[typeof module]&&module&&!module.nodeType&&module,i=(o&&o.exports===r&&r,e[typeof global]&&global);!i||i.global!==i&&i.window!==i||(n=i),"function"==typeof define&&define.amd?define(["rx","exports"],function(e,r){return n.Rx=t(n,r,e),n.Rx}):"object"==typeof module&&module&&module.exports===r?module.exports=t(n,module.exports,require("./rx")):n.Rx=t(n,{},n.Rx)}).call(this,function(t,e,n){function r(){}function o(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:y.call(t)}function i(t){this.patterns=t}function s(t,e){this.expression=t,this.selector=e}function u(t,e,n){var r=t.get(e);if(!r){var o=new g(e,n);return t.set(e,o),o}return r}function c(t,e,n){var r,o;for(this.joinObserverArray=t,this.onNext=e,this.onCompleted=n,this.joinObservers=new w,r=0;this.joinObserverArray.length>r;r++)o=this.joinObserverArray[r],this.joinObservers.set(o,o)}var a=n.Observable,l=a.prototype,h=n.AnonymousObservable,f=a.throwException,p=n.Observer.create,d=n.SingleAssignmentDisposable,b=n.CompositeDisposable,v=n.internals.AbstractObserver;n.internals.isEqual;var m=n.internals.inherits,y=Array.prototype.slice,w=function(){function t(){this.keys=[],this.values=[]}return t.prototype["delete"]=function(t){var e=this.keys.indexOf(t);return-1!==e&&(this.keys.splice(e,1),this.values.splice(e,1)),-1!==e},t.prototype.get=function(t,e){var n=this.keys.indexOf(t);return-1!==n?this.values[n]:e},t.prototype.set=function(t,e){var n=this.keys.indexOf(t);-1!==n&&(this.values[n]=e),this.values[this.keys.push(t)-1]=e},t.prototype.size=function(){return this.keys.length},t.prototype.has=function(t){return-1!==this.keys.indexOf(t)},t.prototype.getKeys=function(){return this.keys.slice(0)},t.prototype.getValues=function(){return this.values.slice(0)},t}();i.prototype.and=function(t){var e=this.patterns.slice(0);return e.push(t),new i(e)},i.prototype.then=function(t){return new s(this,t)},s.prototype.activate=function(t,e,n){for(var r=this,o=[],i=0,s=this.expression.patterns.length;s>i;i++)o.push(u(t,this.expression.patterns[i],e.onError.bind(e)));var a=new c(o,function(){var t;try{t=r.selector.apply(r,arguments)}catch(n){return e.onError(n),undefined}e.onNext(t)},function(){for(var t=0,e=o.length;e>t;t++)o[t].removeActivePlan(a);n(a)});for(i=0,s=o.length;s>i;i++)o[i].addActivePlan(a);return a},c.prototype.dequeue=function(){for(var t=this.joinObservers.getValues(),e=0,n=t.length;n>e;e++)t[e].queue.shift()},c.prototype.match=function(){var t,e,n,r,o,i=!0;for(e=0,n=this.joinObserverArray.length;n>e;e++)if(0===this.joinObserverArray[e].queue.length){i=!1;break}if(i){for(t=[],r=!1,e=0,n=this.joinObserverArray.length;n>e;e++)t.push(this.joinObserverArray[e].queue[0]),"C"===this.joinObserverArray[e].queue[0].kind&&(r=!0);if(r)this.onCompleted();else{for(this.dequeue(),o=[],e=0;t.length>e;e++)o.push(t[e].value);this.onNext.apply(this,o)}}};var g=function(t){function e(e,n){t.call(this),this.source=e,this.onError=n,this.queue=[],this.activePlans=[],this.subscription=new d,this.isDisposed=!1}m(e,t);var n=e.prototype;return n.next=function(t){if(!this.isDisposed){if("E"===t.kind)return this.onError(t.exception),undefined;this.queue.push(t);for(var e=this.activePlans.slice(0),n=0,r=e.length;r>n;n++)e[n].match()}},n.error=r,n.completed=r,n.addActivePlan=function(t){this.activePlans.push(t)},n.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},n.removeActivePlan=function(t){var e=this.activePlans.indexOf(t);this.activePlans.splice(e,1),0===this.activePlans.length&&this.dispose()},n.dispose=function(){t.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},e}(v);return l.and=function(t){return new i([this,t])},l.then=function(t){return new i([this]).then(t)},a.when=function(){var t=o(arguments,0);return new h(function(e){var n,r,o,i,s,u,c=[],a=new w;u=p(e.onNext.bind(e),function(t){for(var n=a.getValues(),r=0,o=n.length;o>r;r++)n[r].onError(t);e.onError(t)},e.onCompleted.bind(e));try{for(r=0,o=t.length;o>r;r++)c.push(t[r].activate(a,u,function(t){var e=c.indexOf(t);c.splice(e,1),0===c.length&&u.onCompleted()}))}catch(l){f(l).subscribe(e)}for(n=new b,s=a.getValues(),r=0,o=s.length;o>r;r++)i=s[r],i.subscribe(),n.add(i);return n})},n});
|
@@ -23,26 +23,33 @@
|
|
23
23
|
|
24
24
|
var Rx = { internals: {}, config: {} };
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
26
|
+
// Defaults
|
27
|
+
function noop() { }
|
28
|
+
function identity(x) { return x; }
|
29
|
+
var defaultNow = Date.now;
|
30
|
+
function defaultComparer(x, y) { return isEqual(x, y); }
|
31
|
+
function defaultSubComparer(x, y) { return x - y; }
|
32
|
+
function defaultKeySerializer(x) { return x.toString(); }
|
33
|
+
function defaultError(err) { throw err; }
|
34
|
+
function isPromise(p) { return typeof p.then === 'function' && typeof p.subscribe === 'undefined'; }
|
35
|
+
|
36
|
+
// Errors
|
37
|
+
var sequenceContainsNoElements = 'Sequence contains no elements.';
|
38
|
+
var argumentOutOfRange = 'Argument out of range';
|
39
|
+
var objectDisposed = 'Object has been disposed';
|
40
|
+
function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } }
|
41
|
+
|
42
|
+
// Shim in iterator support
|
43
|
+
var $iterator$ = (typeof Symbol === 'object' && Symbol.iterator) ||
|
44
|
+
'_es6shim_iterator_';
|
45
|
+
// Firefox ships a partial implementation using the name @@iterator.
|
46
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14
|
47
|
+
// So use that name if we detect it.
|
48
|
+
if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
|
49
|
+
$iterator$ = '@@iterator';
|
50
|
+
}
|
51
|
+
var doneEnumerator = { done: true, value: undefined };
|
52
|
+
|
46
53
|
/** `Object#toString` result shortcuts */
|
47
54
|
var argsClass = '[object Arguments]',
|
48
55
|
arrayClass = '[object Array]',
|
@@ -1512,155 +1519,143 @@
|
|
1512
1519
|
};
|
1513
1520
|
}());
|
1514
1521
|
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
*/
|
1519
|
-
var Enumerator = Rx.internals.Enumerator = function (moveNext, getCurrent) {
|
1520
|
-
this.moveNext = moveNext;
|
1521
|
-
this.getCurrent = getCurrent;
|
1522
|
-
};
|
1522
|
+
var Enumerator = Rx.internals.Enumerator = function (next) {
|
1523
|
+
this._next = next;
|
1524
|
+
};
|
1523
1525
|
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
* @private
|
1528
|
-
*/
|
1529
|
-
var enumeratorCreate = Enumerator.create = function (moveNext, getCurrent) {
|
1530
|
-
var done = false;
|
1531
|
-
return new Enumerator(function () {
|
1532
|
-
if (done) {
|
1533
|
-
return false;
|
1534
|
-
}
|
1535
|
-
var result = moveNext();
|
1536
|
-
if (!result) {
|
1537
|
-
done = true;
|
1538
|
-
}
|
1539
|
-
return result;
|
1540
|
-
}, function () { return getCurrent(); });
|
1541
|
-
};
|
1542
|
-
|
1543
|
-
var Enumerable = Rx.internals.Enumerable = function (getEnumerator) {
|
1544
|
-
this.getEnumerator = getEnumerator;
|
1545
|
-
};
|
1526
|
+
Enumerator.prototype.next = function () {
|
1527
|
+
return this._next();
|
1528
|
+
};
|
1546
1529
|
|
1547
|
-
|
1548
|
-
var sources = this;
|
1549
|
-
return new AnonymousObservable(function (observer) {
|
1550
|
-
var e = sources.getEnumerator(), isDisposed, subscription = new SerialDisposable();
|
1551
|
-
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
|
1552
|
-
var current, hasNext;
|
1553
|
-
if (isDisposed) { return; }
|
1530
|
+
Enumerator.prototype[$iterator$] = function () { return this; }
|
1554
1531
|
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
current = e.getCurrent();
|
1559
|
-
}
|
1560
|
-
} catch (ex) {
|
1561
|
-
observer.onError(ex);
|
1562
|
-
return;
|
1563
|
-
}
|
1532
|
+
var Enumerable = Rx.internals.Enumerable = function (iterator) {
|
1533
|
+
this._iterator = iterator;
|
1534
|
+
};
|
1564
1535
|
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
}
|
1536
|
+
Enumerable.prototype[$iterator$] = function () {
|
1537
|
+
return this._iterator();
|
1538
|
+
};
|
1569
1539
|
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
}));
|
1581
|
-
});
|
1582
|
-
};
|
1540
|
+
Enumerable.prototype.concat = function () {
|
1541
|
+
var sources = this;
|
1542
|
+
return new AnonymousObservable(function (observer) {
|
1543
|
+
var e;
|
1544
|
+
try {
|
1545
|
+
e = sources[$iterator$]();
|
1546
|
+
} catch(err) {
|
1547
|
+
observer.onError();
|
1548
|
+
return;
|
1549
|
+
}
|
1583
1550
|
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
|
1590
|
-
var current, hasNext;
|
1591
|
-
if (isDisposed) { return; }
|
1551
|
+
var isDisposed,
|
1552
|
+
subscription = new SerialDisposable();
|
1553
|
+
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
|
1554
|
+
var currentItem;
|
1555
|
+
if (isDisposed) { return; }
|
1592
1556
|
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
observer.onError(ex);
|
1600
|
-
return;
|
1601
|
-
}
|
1557
|
+
try {
|
1558
|
+
currentItem = e.next();
|
1559
|
+
} catch (ex) {
|
1560
|
+
observer.onError(ex);
|
1561
|
+
return;
|
1562
|
+
}
|
1602
1563
|
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
observer.onCompleted();
|
1608
|
-
}
|
1609
|
-
return;
|
1610
|
-
}
|
1564
|
+
if (currentItem.done) {
|
1565
|
+
observer.onCompleted();
|
1566
|
+
return;
|
1567
|
+
}
|
1611
1568
|
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
},
|
1620
|
-
observer.onCompleted.bind(observer)));
|
1621
|
-
});
|
1622
|
-
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
|
1623
|
-
isDisposed = true;
|
1624
|
-
}));
|
1569
|
+
var d = new SingleAssignmentDisposable();
|
1570
|
+
subscription.setDisposable(d);
|
1571
|
+
d.setDisposable(currentItem.value.subscribe(
|
1572
|
+
observer.onNext.bind(observer),
|
1573
|
+
observer.onError.bind(observer),
|
1574
|
+
function () { self(); })
|
1575
|
+
);
|
1625
1576
|
});
|
1626
|
-
};
|
1627
1577
|
|
1578
|
+
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
|
1579
|
+
isDisposed = true;
|
1580
|
+
}));
|
1581
|
+
});
|
1582
|
+
};
|
1628
1583
|
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1584
|
+
Enumerable.prototype.catchException = function () {
|
1585
|
+
var sources = this;
|
1586
|
+
return new AnonymousObservable(function (observer) {
|
1587
|
+
var e;
|
1588
|
+
try {
|
1589
|
+
e = sources[$iterator$]();
|
1590
|
+
} catch(err) {
|
1591
|
+
observer.onError();
|
1592
|
+
return;
|
1593
|
+
}
|
1594
|
+
|
1595
|
+
var isDisposed,
|
1596
|
+
lastException,
|
1597
|
+
subscription = new SerialDisposable();
|
1598
|
+
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
|
1599
|
+
if (isDisposed) { return; }
|
1600
|
+
|
1601
|
+
var currentItem;
|
1602
|
+
try {
|
1603
|
+
currentItem = e.next();
|
1604
|
+
} catch (ex) {
|
1605
|
+
observer.onError(ex);
|
1606
|
+
return;
|
1632
1607
|
}
|
1633
|
-
return new Enumerable(function () {
|
1634
|
-
var current, left = repeatCount;
|
1635
|
-
return enumeratorCreate(function () {
|
1636
|
-
if (left === 0) {
|
1637
|
-
return false;
|
1638
|
-
}
|
1639
|
-
if (left > 0) {
|
1640
|
-
left--;
|
1641
|
-
}
|
1642
|
-
current = value;
|
1643
|
-
return true;
|
1644
|
-
}, function () { return current; });
|
1645
|
-
});
|
1646
|
-
};
|
1647
1608
|
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1609
|
+
if (currentItem.done) {
|
1610
|
+
if (lastException) {
|
1611
|
+
observer.onError(lastException);
|
1612
|
+
} else {
|
1613
|
+
observer.onCompleted();
|
1614
|
+
}
|
1615
|
+
return;
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
var d = new SingleAssignmentDisposable();
|
1619
|
+
subscription.setDisposable(d);
|
1620
|
+
d.setDisposable(currentItem.value.subscribe(
|
1621
|
+
observer.onNext.bind(observer),
|
1622
|
+
function (exn) {
|
1623
|
+
lastException = exn;
|
1624
|
+
self();
|
1625
|
+
},
|
1626
|
+
observer.onCompleted.bind(observer)));
|
1627
|
+
});
|
1628
|
+
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
|
1629
|
+
isDisposed = true;
|
1630
|
+
}));
|
1631
|
+
});
|
1632
|
+
};
|
1633
|
+
|
1634
|
+
|
1635
|
+
var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
|
1636
|
+
if (repeatCount == null) { repeatCount = -1; }
|
1637
|
+
return new Enumerable(function () {
|
1638
|
+
var left = repeatCount;
|
1639
|
+
return new Enumerator(function () {
|
1640
|
+
if (left === 0) { return doneEnumerator; }
|
1641
|
+
if (left > 0) { left--; }
|
1642
|
+
return { done: false, value: value };
|
1643
|
+
});
|
1644
|
+
});
|
1645
|
+
};
|
1646
|
+
|
1647
|
+
var enumerableFor = Enumerable.forEach = function (source, selector, thisArg) {
|
1648
|
+
selector || (selector = identity);
|
1649
|
+
return new Enumerable(function () {
|
1650
|
+
var index = -1;
|
1651
|
+
return new Enumerator(
|
1652
|
+
function () {
|
1653
|
+
return ++index < source.length ?
|
1654
|
+
{ done: false, value: selector.call(thisArg, source[index], index, source) } :
|
1655
|
+
doneEnumerator;
|
1662
1656
|
});
|
1663
|
-
};
|
1657
|
+
});
|
1658
|
+
};
|
1664
1659
|
|
1665
1660
|
/**
|
1666
1661
|
* Supports push-style iteration over an observable sequence.
|
@@ -2252,37 +2247,44 @@
|
|
2252
2247
|
});
|
2253
2248
|
};
|
2254
2249
|
|
2255
|
-
|
2256
|
-
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2250
|
+
/**
|
2251
|
+
* Converts an iterable into an Observable sequence
|
2252
|
+
*
|
2253
|
+
* @example
|
2254
|
+
* var res = Rx.Observable.fromIterable(new Map());
|
2255
|
+
* var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout);
|
2256
|
+
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
|
2257
|
+
* @returns {Observable} The observable sequence whose elements are pulled from the given generator sequence.
|
2258
|
+
*/
|
2259
|
+
Observable.fromIterable = function (iterable, scheduler) {
|
2260
|
+
scheduler || (scheduler = currentThreadScheduler);
|
2261
|
+
return new AnonymousObservable(function (observer) {
|
2262
|
+
var iterator;
|
2263
|
+
try {
|
2264
|
+
iterator = iterable[$iterator$]();
|
2265
|
+
} catch (e) {
|
2266
|
+
observer.onError(e);
|
2267
|
+
return;
|
2268
|
+
}
|
2274
2269
|
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2270
|
+
return scheduler.scheduleRecursive(function (self) {
|
2271
|
+
var next;
|
2272
|
+
try {
|
2273
|
+
next = iterator.next();
|
2274
|
+
} catch (err) {
|
2275
|
+
observer.onError(err);
|
2276
|
+
return;
|
2277
|
+
}
|
2278
|
+
|
2279
|
+
if (next.done) {
|
2280
|
+
observer.onCompleted();
|
2281
|
+
} else {
|
2282
|
+
observer.onNext(next.value);
|
2283
|
+
self();
|
2284
|
+
}
|
2285
|
+
});
|
2286
|
+
});
|
2287
|
+
};
|
2286
2288
|
|
2287
2289
|
/**
|
2288
2290
|
* Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
|