Repository navigation
Expand file tree
/
Copy pathrx.experimental.min.js
More file actions
3 lines (3 loc) · 5.43 KB
/
Copy pathrx.experimental.min.js
File metadata and controls
3 lines (3 loc) · 5.43 KB
1
2
3
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["./rx"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){return function(){try{return a.apply(this,arguments)}catch(b){return E.e=b,E}}}function f(a,b){return new G(a,b)}var g=c.Observable,h=g.prototype,i=c.AnonymousObservable,j=g.concat,k=g.defer,l=g.empty,m=c.Disposable.empty,n=c.CompositeDisposable,o=c.SerialDisposable,p=c.SingleAssignmentDisposable,q=(c.internals.Enumerator,c.internals.Enumerable),r=q.of,s=c.Scheduler.immediate,t=c.Scheduler.currentThread,u=(Array.prototype.slice,c.AsyncSubject),v=c.Observer,w=c.internals.inherits,x=(c.internals.bindCallback,c.internals.addProperties),y=c.helpers,z=y.noop,A=y.isPromise,B=y.isFunction,C=c.Scheduler.isScheduler,D=g.fromPromise,E={e:{}},F=(c.internals.tryCatch=function(a){if(!B(a))throw new TypeError("fn must be a function");return e(a)},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(F="@@iterator");c.doneEnumerator={done:!0,value:d},c.helpers.isIterable=function(a){return a[F]!==d},c.helpers.isArrayLike=function(a){return a&&a.length!==d};c.helpers.iterator=F;var G=function(a){function b(a,b){this.c=a,this.s=b}return w(b,a),b.prototype[F]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(q);h.letBind=h.let=function(a){return a(this)},g["if"]=function(a,b,c){return k(function(){return c||(c=l()),A(b)&&(b=D(b)),A(c)&&(c=D(c)),"function"==typeof c.now&&(c=l(c)),a()?b:c})},g["for"]=g.forIn=function(a,b,c){return r(a,b,c).concat()};var H=g["while"]=g.whileDo=function(a,b){return A(b)&&(b=D(b)),f(a,b).concat()};h.doWhile=function(a){return j([this,H(a,this)])},g["case"]=function(a,b,c){return k(function(){A(c)&&(c=D(c)),c||(c=l()),C(c)&&(c=l(c));var d=b[a()];return A(d)&&(d=D(d)),d||c})},h.expand=function(a,b){C(b)||(b=s);var c=this;return new i(function(d){var e=[],f=new o,g=new n(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new p;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},g.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new i(function(b){var c=a.length;if(0===c)return b.onCompleted(),m;for(var d=new n,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];A(j)&&(j=D(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},h.forkJoin=function(a,b){var c=this;return new i(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new p,l=new p;return A(a)&&(a=D(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new n(k,l)},c)},h.manySelect=h.extend=function(a,b){C(b)||(b=s);var c=this;return k(function(){var d;return c.map(function(a){var b=new I(a);return d&&d.onNext(a),d=b,b}).tap(z,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var I=function(a){function b(a){var b=this,c=new n;return c.add(t.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new u}return w(c,a),x(c.prototype,v,{onCompleted:function(){this.onNext(g.empty())},onError:function(a){this.onNext(g["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(g);return h.switchFirst=function(){var a=this;return new i(function(b){var c=!1,d=!1,e=new p,f=new n;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,A(a)&&(a=D(a));var e=new p;f.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},function(a){b.onError(a)},function(){d=!0,!c&&1===f.length&&b.onCompleted()})),f},this)},h.flatMapFirst=h.selectManyFirst=function(a,b,c){return new FlatMapObservable(this,a,b,c).switchFirst()},c.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new FlatMapObservable(this,b,c,d).merge(a)},c});
//# sourceMappingURL=rx.experimental.map