Comparing version 2.1.7 to 2.1.8
{ | ||
"name": "Rx", | ||
"version": "2.1.7", | ||
"version": "2.1.8", | ||
"main": [ | ||
@@ -5,0 +5,0 @@ "rx.js", |
@@ -1,2 +0,2 @@ | ||
# Rx.js <sup>v2.1.7</sup> | ||
# Rx.js <sup>v2.1.8</sup> | ||
@@ -88,2 +88,3 @@ <!-- div --> | ||
- [lastOrDefault](#lastOrDefault) | ||
- [manySelect](#manySelect) | ||
- [max](#max) | ||
@@ -90,0 +91,0 @@ - [maxBy](#maxBy) |
@@ -0,0 +0,0 @@ jasmine.HtmlReporterHelpers = {}; |
@@ -5,3 +5,3 @@ { | ||
"description": "Library for composing asynchronous and event-based operations in JavaScript", | ||
"version": "2.1.7", | ||
"version": "2.1.8", | ||
"homepage": "http://rx.codeplex.com", | ||
@@ -8,0 +8,0 @@ "author": { |
@@ -40,5 +40,10 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. | ||
immediateScheduler = Rx.Scheduler.immediate, | ||
slice = Array.prototype.slice; | ||
slice = Array.prototype.slice, | ||
AsyncSubject = Rx.AsyncSubject, | ||
Observer = Rx.Observer, | ||
inherits = Rx.Internals.inherits, | ||
addProperties = Rx.Internals.addProperties; | ||
// Utilities | ||
function nothing () { } | ||
function argsOrArray(args, idx) { | ||
@@ -371,3 +376,80 @@ return args.length === 1 && Array.isArray(args[idx]) ? | ||
/** | ||
* Comonadic bind operator. | ||
* @param {Function} selector A transform function to apply to each element. | ||
* @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. | ||
* @returns {Observable} An observable sequence which results from the comonadic bind operation. | ||
*/ | ||
observableProto.manySelect = function (selector, scheduler) { | ||
scheduler || (scheduler = immediateScheduler); | ||
var source = this; | ||
return Observable.defer(function () { | ||
var chain; | ||
return source | ||
.select( | ||
function (x) { | ||
var curr = new ChainObservable(x); | ||
if (chain) { | ||
chain.onNext(x); | ||
} | ||
chain = curr; | ||
return curr; | ||
}) | ||
.doAction( | ||
nothing, | ||
function (e) { | ||
if (chain) { | ||
chain.onError(e); | ||
} | ||
}, | ||
function () { | ||
if (chain) { | ||
chain.onCompleted(); | ||
} | ||
}) | ||
.observeOn(scheduler) | ||
.select(function (x, i, o) { return selector(x, i, o); }); | ||
}); | ||
}; | ||
var ChainObservable = (function (_super) { | ||
function subscribe (observer) { | ||
var self = this, g = new CompositeDisposable(); | ||
g.add(Scheduler.currentThread.schedule(function () { | ||
observer.onNext(self.head); | ||
g.add(tail.mergeObservable().subscribe(observer)); | ||
})); | ||
return g; | ||
} | ||
inherits(ChainObservable, _super); | ||
function ChainObservable(head) { | ||
_super.call(this, subscribe); | ||
this.head = head; | ||
this.tail = new AsyncSubject(); | ||
} | ||
addProperties(ChainObservable.prototype, Observer, { | ||
onCompleted: function () { | ||
this.onNext(Observable.empty()); | ||
}, | ||
onError: function (e) { | ||
this.onNext(Observable.throwException(e)); | ||
}, | ||
onNext: function (v) { | ||
this.tail.onNext(v); | ||
this.tail.onCompleted(); | ||
} | ||
}); | ||
return ChainObservable; | ||
}(Observable)); | ||
return Rx; | ||
})); |
@@ -1,1 +0,1 @@ | ||
(function(t,e){var n="object"==typeof exports&&exports,r=("object"==typeof module&&module&&module.exports==n&&module,"object"==typeof global&&global);r.global===r&&(window=r),"function"==typeof define&&define.amd?define(["rx","exports"],function(n,r){return t.Rx=e(t,r,n),t.Rx}):"object"==typeof module&&module&&module.exports===n?module.exports=e(t,module.exports,require("./rx")):t.Rx=e(t,{},t.Rx)})(this,function(t,e,n,r){function i(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:g.call(t)}function o(t,e){return new m(function(){var n;return v(function(){return t()?(n=e,!0):!1},function(){return n})})}var s=n.Observable,u=s.prototype,c=s.createWithDisposable,a=s.concat,h=s.defer,l=s.empty,f=n.Disposable.empty,p=(n.Internals.BinaryObserver,n.CompositeDisposable),d=n.SerialDisposable,b=n.SingleAssignmentDisposable,v=n.Internals.Enumerator.create,m=n.Internals.Enumerable,y=m.forEach,w=n.Scheduler.immediate,g=Array.prototype.slice;u.letBind=function(t){return t(this)},s["if"]=s.ifThen=function(t,e,n){return h(function(){if(n||(n=l()),n.now){var r=n;n=l(r)}return t()?e:n})},s["for"]=s.forIn=function(t,e){return y(t,e).concat()};var E=s["while"]=s.whileDo=function(t,e){return o(t,e).concat()};return u.doWhile=function(t){return a([this,E(t,this)])},s["case"]=s.switchCase=function(t,e,n){return h(function(){if(n||(n=l()),n.now){var i=n;n=l(i)}var o=e[t()];return o!==r?o:n})},u.expand=function(t,e){e||(e=w);var n=this;return c(function(i){var o=[],s=new d,u=new p(s),c=0,a=!1,h=function(){var n=!1;o.length>0&&(n=!a,a=!0),n&&s.setDisposable(e.scheduleRecursive(function(e){var n;if(!(o.length>0))return a=!1,r;n=o.shift();var s=new b;u.add(s),s.setDisposable(n.subscribe(function(e){i.onNext(e);var n=null;try{n=t(e)}catch(r){i.onError(r)}o.push(n),c++,h()},i.onError.bind(i),function(){u.remove(s),c--,0===c&&i.onCompleted()})),e()}))};return o.push(n),c++,h(),u})},s.forkJoin=function(){var t=i(arguments,0);return c(function(e){var n=t.length;if(0===n)return e.onCompleted(),f;for(var i=new p,o=!1,s=Array(n),u=Array(n),c=Array(n),a=0;n>a;a++)(function(a){var h=t[a];i.add(h.subscribe(function(t){o||(s[a]=!0,c[a]=t)},function(t){o=!0,e.onError(t),i.dispose()},function(){if(!o){if(!s[a])return e.onCompleted(),r;u[a]=!0;for(var t=0;n>t;t++)if(!u[t])return;o=!0,e.onNext(c),e.onCompleted()}}))})(a);return i})},u.forkJoin=function(t,e){var n=this;return c(function(i){var o,s,u=!1,c=!1,a=!1,h=!1,l=new b,f=new b;return l.setDisposable(n.subscribe(function(t){a=!0,o=t},function(t){f.dispose(),i.onError(t)},function(){if(u=!0,c)if(a)if(h){var t;try{t=e(o,s)}catch(n){return i.onError(n),r}i.onNext(t),i.onCompleted()}else i.onCompleted();else i.onCompleted()})),f.setDisposable(t.subscribe(function(t){h=!0,s=t},function(t){l.dispose(),i.onError(t)},function(){if(c=!0,u)if(a)if(h){var t;try{t=e(o,s)}catch(n){return i.onError(n),r}i.onNext(t),i.onCompleted()}else i.onCompleted();else i.onCompleted()})),new p(l,f)})},n}); | ||
(function(t,e){var n="object"==typeof exports&&exports,r=("object"==typeof module&&module&&module.exports==n&&module,"object"==typeof global&&global);r.global===r&&(window=r),"function"==typeof define&&define.amd?define(["rx","exports"],function(n,r){return t.Rx=e(t,r,n),t.Rx}):"object"==typeof module&&module&&module.exports===n?module.exports=e(t,module.exports,require("./rx")):t.Rx=e(t,{},t.Rx)})(this,function(t,e,n,r){function i(){}function o(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:E.call(t)}function s(t,e){return new y(function(){var n;return m(function(){return t()?(n=e,!0):!1},function(){return n})})}var u=n.Observable,c=u.prototype,a=u.createWithDisposable,h=u.concat,l=u.defer,f=u.empty,p=n.Disposable.empty,d=(n.Internals.BinaryObserver,n.CompositeDisposable),b=n.SerialDisposable,v=n.SingleAssignmentDisposable,m=n.Internals.Enumerator.create,y=n.Internals.Enumerable,w=y.forEach,g=n.Scheduler.immediate,E=Array.prototype.slice,x=n.AsyncSubject,C=n.Observer,D=n.Internals.inherits,A=n.Internals.addProperties;c.letBind=function(t){return t(this)},u["if"]=u.ifThen=function(t,e,n){return l(function(){if(n||(n=f()),n.now){var r=n;n=f(r)}return t()?e:n})},u["for"]=u.forIn=function(t,e){return w(t,e).concat()};var S=u["while"]=u.whileDo=function(t,e){return s(t,e).concat()};c.doWhile=function(t){return h([this,S(t,this)])},u["case"]=u.switchCase=function(t,e,n){return l(function(){if(n||(n=f()),n.now){var i=n;n=f(i)}var o=e[t()];return o!==r?o:n})},c.expand=function(t,e){e||(e=g);var n=this;return a(function(i){var o=[],s=new b,u=new d(s),c=0,a=!1,h=function(){var n=!1;o.length>0&&(n=!a,a=!0),n&&s.setDisposable(e.scheduleRecursive(function(e){var n;if(!(o.length>0))return a=!1,r;n=o.shift();var s=new v;u.add(s),s.setDisposable(n.subscribe(function(e){i.onNext(e);var n=null;try{n=t(e)}catch(r){i.onError(r)}o.push(n),c++,h()},i.onError.bind(i),function(){u.remove(s),c--,0===c&&i.onCompleted()})),e()}))};return o.push(n),c++,h(),u})},u.forkJoin=function(){var t=o(arguments,0);return a(function(e){var n=t.length;if(0===n)return e.onCompleted(),p;for(var i=new d,o=!1,s=Array(n),u=Array(n),c=Array(n),a=0;n>a;a++)(function(a){var h=t[a];i.add(h.subscribe(function(t){o||(s[a]=!0,c[a]=t)},function(t){o=!0,e.onError(t),i.dispose()},function(){if(!o){if(!s[a])return e.onCompleted(),r;u[a]=!0;for(var t=0;n>t;t++)if(!u[t])return;o=!0,e.onNext(c),e.onCompleted()}}))})(a);return i})},c.forkJoin=function(t,e){var n=this;return a(function(i){var o,s,u=!1,c=!1,a=!1,h=!1,l=new v,f=new v;return l.setDisposable(n.subscribe(function(t){a=!0,o=t},function(t){f.dispose(),i.onError(t)},function(){if(u=!0,c)if(a)if(h){var t;try{t=e(o,s)}catch(n){return i.onError(n),r}i.onNext(t),i.onCompleted()}else i.onCompleted();else i.onCompleted()})),f.setDisposable(t.subscribe(function(t){h=!0,s=t},function(t){l.dispose(),i.onError(t)},function(){if(c=!0,u)if(a)if(h){var t;try{t=e(o,s)}catch(n){return i.onError(n),r}i.onNext(t),i.onCompleted()}else i.onCompleted();else i.onCompleted()})),new d(l,f)})},c.manySelect=function(t,e){e||(e=g);var n=this;return u.defer(function(){var r;return n.select(function(t){var e=new N(t);return r&&r.onNext(t),r=e,e}).doAction(i,function(t){r&&r.onError(t)},function(){r&&r.onCompleted()}).observeOn(e).select(function(e,n,r){return t(e,n,r)})})};var N=function(t){function e(t){var e=this,n=new d;return n.add(Scheduler.currentThread.schedule(function(){t.onNext(e.head),n.add(tail.mergeObservable().subscribe(t))})),n}function n(n){t.call(this,e),this.head=n,this.tail=new x}return D(n,t),A(n.prototype,C,{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 +0,1 @@ | ||
(function(t,e){var n="object"==typeof exports&&exports,r=("object"==typeof module&&module&&module.exports==n&&module,"object"==typeof global&&global);r.global===r&&(window=r),"function"==typeof define&&define.amd?define(["rx","exports"],function(n,r){return t.Rx=e(t,r,n),t.Rx}):"object"==typeof module&&module&&module.exports===n?module.exports=e(t,module.exports,require("./rx")):t.Rx=e(t,{},t.Rx)})(this,function(t,e,n){function r(){}function i(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:y.call(t)}function o(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 i=new w(e,n);return t.set(e,i),i}return r}function c(t,e,n){var r,i;for(this.joinObserverArray=t,this.onNext=e,this.onCompleted=n,this.joinObservers=new g,r=0;this.joinObserverArray.length>r;r++)i=this.joinObserverArray[r],this.joinObservers.set(i,i)}var a=n.Observable,h=a.prototype,l=n.Internals.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,g=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}();o.prototype.and=function(t){var e=this.patterns.slice(0);return e.push(t),new o(e)},o.prototype.then=function(t){return new s(this,t)},s.prototype.activate=function(t,e,n){for(var r=this,i=[],o=0,s=this.expression.patterns.length;s>o;o++)i.push(u(t,this.expression.patterns[o],e.onError.bind(e)));var a=new c(i,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=i.length;e>t;t++)i[t].removeActivePlan(a);n(a)});for(o=0,s=i.length;s>o;o++)i[o].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,i,o=!0;for(e=0,n=this.joinObserverArray.length;n>e;e++)if(0===this.joinObserverArray[e].queue.length){o=!1;break}if(o){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(),i=[],e=0;t.length>e;e++)i.push(t[e].value);this.onNext.apply(this,i)}}};var w=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.disposable(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 h.and=function(t){return new o([this,t])},h.then=function(t){return new o([this]).then(t)},a.when=function(){var t=i(arguments,0);return new l(function(e){var n,r,i,o,s,u,c=[],a=new g;u=p(e.onNext.bind(e),function(t){for(var n=a.getValues(),r=0,i=n.length;i>r;r++)n[r].onError(t);e.onError(t)},e.onCompleted.bind(e));try{for(r=0,i=t.length;i>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(h){f(h).subscribe(e)}for(n=new b,s=a.getValues(),r=0,i=s.length;i>r;r++)o=s[r],o.subscribe(),n.add(o);return n})},n}); | ||
(function(t,e){var n="object"==typeof exports&&exports,r=("object"==typeof module&&module&&module.exports==n&&module,"object"==typeof global&&global);r.global===r&&(window=r),"function"==typeof define&&define.amd?define(["rx","exports"],function(n,r){return t.Rx=e(t,r,n),t.Rx}):"object"==typeof module&&module&&module.exports===n?module.exports=e(t,module.exports,require("./rx")):t.Rx=e(t,{},t.Rx)})(this,function(t,e,n){function r(){}function i(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:y.call(t)}function o(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 i=new g(e,n);return t.set(e,i),i}return r}function c(t,e,n){var r,i;for(this.joinObserverArray=t,this.onNext=e,this.onCompleted=n,this.joinObservers=new w,r=0;this.joinObserverArray.length>r;r++)i=this.joinObserverArray[r],this.joinObservers.set(i,i)}var a=n.Observable,h=a.prototype,l=n.Internals.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}();o.prototype.and=function(t){var e=this.patterns.slice(0);return e.push(t),new o(e)},o.prototype.then=function(t){return new s(this,t)},s.prototype.activate=function(t,e,n){for(var r=this,i=[],o=0,s=this.expression.patterns.length;s>o;o++)i.push(u(t,this.expression.patterns[o],e.onError.bind(e)));var a=new c(i,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=i.length;e>t;t++)i[t].removeActivePlan(a);n(a)});for(o=0,s=i.length;s>o;o++)i[o].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,i,o=!0;for(e=0,n=this.joinObserverArray.length;n>e;e++)if(0===this.joinObserverArray[e].queue.length){o=!1;break}if(o){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(),i=[],e=0;t.length>e;e++)i.push(t[e].value);this.onNext.apply(this,i)}}};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.disposable(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 h.and=function(t){return new o([this,t])},h.then=function(t){return new o([this]).then(t)},a.when=function(){var t=i(arguments,0);return new l(function(e){var n,r,i,o,s,u,c=[],a=new w;u=p(e.onNext.bind(e),function(t){for(var n=a.getValues(),r=0,i=n.length;i>r;r++)n[r].onError(t);e.onError(t)},e.onCompleted.bind(e));try{for(r=0,i=t.length;i>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(h){f(h).subscribe(e)}for(n=new b,s=a.getValues(),r=0,i=s.length;i>r;r++)o=s[r],o.subscribe(),n.add(o);return n})},n}); |
@@ -17,5 +17,10 @@ // Aliases | ||
immediateScheduler = Rx.Scheduler.immediate, | ||
slice = Array.prototype.slice; | ||
slice = Array.prototype.slice, | ||
AsyncSubject = Rx.AsyncSubject, | ||
Observer = Rx.Observer, | ||
inherits = Rx.Internals.inherits, | ||
addProperties = Rx.Internals.addProperties; | ||
// Utilities | ||
function nothing () { } | ||
function argsOrArray(args, idx) { | ||
@@ -22,0 +27,0 @@ return args.length === 1 && Array.isArray(args[idx]) ? |
@@ -321,1 +321,78 @@ function enumerableWhile(condition, source) { | ||
}; | ||
/** | ||
* Comonadic bind operator. | ||
* @param {Function} selector A transform function to apply to each element. | ||
* @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. | ||
* @returns {Observable} An observable sequence which results from the comonadic bind operation. | ||
*/ | ||
observableProto.manySelect = function (selector, scheduler) { | ||
scheduler || (scheduler = immediateScheduler); | ||
var source = this; | ||
return Observable.defer(function () { | ||
var chain; | ||
return source | ||
.select( | ||
function (x) { | ||
var curr = new ChainObservable(x); | ||
if (chain) { | ||
chain.onNext(x); | ||
} | ||
chain = curr; | ||
return curr; | ||
}) | ||
.doAction( | ||
nothing, | ||
function (e) { | ||
if (chain) { | ||
chain.onError(e); | ||
} | ||
}, | ||
function () { | ||
if (chain) { | ||
chain.onCompleted(); | ||
} | ||
}) | ||
.observeOn(scheduler) | ||
.select(function (x, i, o) { return selector(x, i, o); }); | ||
}); | ||
}; | ||
var ChainObservable = (function (_super) { | ||
function subscribe (observer) { | ||
var self = this, g = new CompositeDisposable(); | ||
g.add(Scheduler.currentThread.schedule(function () { | ||
observer.onNext(self.head); | ||
g.add(tail.mergeObservable().subscribe(observer)); | ||
})); | ||
return g; | ||
} | ||
inherits(ChainObservable, _super); | ||
function ChainObservable(head) { | ||
_super.call(this, subscribe); | ||
this.head = head; | ||
this.tail = new AsyncSubject(); | ||
} | ||
addProperties(ChainObservable.prototype, Observer, { | ||
onCompleted: function () { | ||
this.onNext(Observable.empty()); | ||
}, | ||
onError: function (e) { | ||
this.onNext(Observable.throwException(e)); | ||
}, | ||
onNext: function (v) { | ||
this.tail.onNext(v); | ||
this.tail.onCompleted(); | ||
} | ||
}); | ||
return ChainObservable; | ||
}(Observable)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1610751
31007