UNPKG

webappengine

Version:

A web application platform that can host multiple web apps running with Node.js.

3 lines 5.36 kB
/* 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,b){return new D(a,b)}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=f.concat,j=f.defer,k=f.empty,l=c.Disposable.empty,m=c.CompositeDisposable,n=c.SerialDisposable,o=c.SingleAssignmentDisposable,p=(c.internals.Enumerator,c.internals.Enumerable),q=p.of,r=c.Scheduler.immediate,s=c.Scheduler.currentThread,t=(Array.prototype.slice,c.AsyncSubject),u=c.Observer,v=c.internals.inherits,w=(c.internals.bindCallback,c.internals.addProperties),x=c.helpers,y=x.noop,z=x.isPromise,A=(x.isFunction,c.Scheduler.isScheduler),B=f.fromPromise,C="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(C="@@iterator");c.doneEnumerator={done:!0,value:d},c.helpers.isIterable=function(a){return a[C]!==d},c.helpers.isArrayLike=function(a){return a&&a.length!==d};c.helpers.iterator=C;var D=function(a){function b(a,b){this.c=a,this.s=b}return v(b,a),b.prototype[C]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(p);g.letBind=g.let=function(a){return a(this)},f["if"]=function(a,b,c){return j(function(){return c||(c=k()),z(b)&&(b=B(b)),z(c)&&(c=B(c)),"function"==typeof c.now&&(c=k(c)),a()?b:c})},f["for"]=f.forIn=function(a,b,c){return q(a,b,c).concat()};var E=f["while"]=f.whileDo=function(a,b){return z(b)&&(b=B(b)),e(a,b).concat()};g.doWhile=function(a){return i([this,E(a,this)])},f["case"]=function(a,b,c){return j(function(){z(c)&&(c=B(c)),c||(c=k()),A(c)&&(c=k(c));var d=b[a()];return z(d)&&(d=B(d)),d||c})},g.expand=function(a,b){A(b)||(b=r);var c=this;return new h(function(d){var e=[],f=new n,g=new m(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 o;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)},f.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 h(function(b){var c=a.length;if(0===c)return b.onCompleted(),l;for(var d=new m,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];z(j)&&(j=B(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})},g.forkJoin=function(a,b){var c=this;return new h(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new o,l=new o;return z(a)&&(a=B(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 m(k,l)},c)},g.manySelect=g.extend=function(a,b){A(b)||(b=r);var c=this;return j(function(){var d;return c.map(function(a){var b=new F(a);return d&&d.onNext(a),d=b,b}).tap(y,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var F=function(a){function b(a){var b=this,c=new m;return c.add(s.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 t}return v(c,a),w(c.prototype,u,{onCompleted:function(){this.onNext(f.empty())},onError:function(a){this.onNext(f["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(f);return g.switchFirst=function(){var a=this;return new h(function(b){var c=!1,d=!1,e=new o,f=new m;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,z(a)&&(a=B(a));var e=new o;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)},g.flatMapFirst=g.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