webappengine
Version:
A web application platform that can host multiple web apps running with Node.js.
3 lines • 6.44 kB
JavaScript
/* 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(){try{return k.apply(this,arguments)}catch(a){return B.e=a,B}}function f(a){if(!z(a))throw new TypeError("fn must be a function");return k=a,e}function g(a){return a.toArray()}function h(a,b){return a.groupJoin(this,b,s,function(a,b){return b})}function i(a){var b=this;return new u(function(c){var d=new q,e=new m,f=new n(e);return c.onNext(v(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),y(a)&&(a=A(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new q,c.onNext(v(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function j(a){var b=this;return new u(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}y(b)&&(b=A(b));var i=new o;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(x,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new q,c.onNext(v(h,g)),d()}))}var e=new p,f=new m(e),g=new n(f),h=new q;return c.onNext(v(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}var k,l=c.Observable,m=c.CompositeDisposable,n=c.RefCountDisposable,o=c.SingleAssignmentDisposable,p=c.SerialDisposable,q=c.Subject,r=l.prototype,s=l.empty,t=l.never,u=c.AnonymousObservable,v=(c.Observer.create,c.internals.addRef),w=(c.internals.isEqual,c.internals.inherits),x=c.helpers.noop,y=(c.helpers.identity,c.helpers.isPromise),z=c.helpers.isFunction,A=(c.internals.bindCallback,l.fromPromise),B=(c.ArgumentOutOfRangeError,{e:{}}),C=a.Map||function(){function a(){this.size=0,this._values=[],this._keys=[]}return a.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1===b?d:this._values[b]},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},a.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},a}();r.join=function(a,b,c,d){var e=this;return new u(function(g){var h=new m,i=!1,j=!1,k=0,l=0,n=new C,p=new C,q=function(a){g.onError(a)};return h.add(e.subscribe(function(a){var c=k++,e=new o;n.set(c,a),h.add(e);var j=f(b)(a);return j===B?g.onError(j.e):(e.setDisposable(j.take(1).subscribe(x,q,function(){n["delete"](c)&&0===n.size&&i&&g.onCompleted(),h.remove(e)})),void p.forEach(function(b){var c=f(d)(a,b);return c===B?g.onError(c.e):void g.onNext(c)}))},q,function(){i=!0,(j||0===n.size)&&g.onCompleted()})),h.add(a.subscribe(function(a){var b=l++,e=new o;p.set(b,a),h.add(e);var i=f(c)(a);return i===B?g.onError(i.e):(e.setDisposable(i.take(1).subscribe(x,q,function(){p["delete"](b)&&0===p.size&&j&&g.onCompleted(),h.remove(e)})),void n.forEach(function(b){var c=f(d)(b,a);return c===B?g.onError(c.e):void g.onNext(c)}))},q,function(){j=!0,(i||0===p.size)&&g.onCompleted()})),h},e)},r.groupJoin=function(a,b,c,d){var e=this;return new u(function(g){function h(a){}var i=new m,j=new n(i),k=new C,l=new C,p=0,r=0,h=function(a){return function(b){b.onError(a)}};return i.add(e.subscribe(function(a){var c=new q,e=p++;k.set(e,c);var m=f(d)(a,v(c,j));if(m===B)return k.forEach(h(m.e)),g.onError(m.e);g.onNext(m),l.forEach(function(a){c.onNext(a)});var n=new o;i.add(n);var r=f(b)(a);return r===B?(k.forEach(h(r.e)),g.onError(r.e)):void n.setDisposable(r.take(1).subscribe(x,function(a){k.forEach(h(a)),g.onError(a)},function(){k["delete"](e)&&c.onCompleted(),i.remove(n)}))},function(a){k.forEach(h(a)),g.onError(a)},function(){g.onCompleted()})),i.add(a.subscribe(function(a){var b=r++;l.set(b,a);var d=new o;i.add(d);var e=f(c)(a);return e===B?(k.forEach(h(e.e)),g.onError(e.e)):(d.setDisposable(e.take(1).subscribe(x,function(a){k.forEach(h(a)),g.onError(a)},function(){l["delete"](b),i.remove(d)})),void k.forEach(function(b){b.onNext(a)}))},function(a){k.forEach(h(a)),g.onError(a)})),j},e)},r.buffer=function(){return this.window.apply(this,arguments).flatMap(g)},r.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?i.call(this,a):"function"==typeof a?j.call(this,a):h.call(this,a,b)},r.pairwise=function(){var a=this;return new u(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},r.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]},r.groupBy=function(a,b){return this.groupByUntil(a,b,t)},r.groupByUntil=function(a,b,c){var e=this;return new u(function(g){var h=new C,i=new m,j=new n(i),k=function(a){return function(b){b.onError(a)}};return i.add(e.subscribe(function(e){var l=f(a)(e);if(l===B)return h.forEach(k(l.e)),g.onError(l.e);var m=!1,n=h.get(l);if(n===d&&(n=new q,h.set(l,n),m=!0),m){var p=new D(l,n,j),r=new D(l,n),s=f(c)(r);if(s===B)return h.forEach(k(s.e)),g.onError(s.e);g.onNext(p);var t=new o;i.add(t),t.setDisposable(s.take(1).subscribe(x,function(a){h.forEach(k(a)),g.onError(a)},function(){h["delete"](l)&&n.onCompleted(),i.remove(t)}))}var u=e;return z(b)&&(u=f(b)(e),u===B)?(h.forEach(k(u.e)),g.onError(u.e)):void n.onNext(u)},function(a){h.forEach(k(a)),g.onError(a)},function(){h.forEach(function(a){a.onCompleted()}),g.onCompleted()})),j},e)};var D=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new u(function(a){return new m(e.getDisposable(),d.subscribe(a))}):d}return w(c,a),c}(l);return c});
//# sourceMappingURL=rx.coincidence.map