webappengine
Version:
A web application platform that can host multiple web apps running with Node.js.
3 lines • 5.29 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.binding","exports"],function(b,c){return h.Rx=a(h,c,b),h.Rx}):"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 t.apply(this,arguments)}catch(a){return F.e=a,F}}function f(a){if(!E(a))throw new TypeError("fn must be a function");return t=a,e}function g(a){return a?u.isObservable(a)?a:D(a)?u.fromPromise(a):l(a)||k(a)?G.call(this,a):E(a)?j.call(this,a):isArrayLike(a)||isIterable(a)?h.call(this,a):m(a)?i.call(this,a):a:a}function h(a){return u.from(a).map(g,this).toArray()}function i(a){function b(a,b){c[b]=d,f.push(new x(function(d){return a.subscribe(function(a){c[b]=a,d.onCompleted()})}))}for(var c=new a.constructor,e=Object.keys(a),f=[],h=0,i=e.length;i>h;h++){var j=e[h],k=g.call(this,a[j]);k&&u.isObservable(k)?b(k,j):c[j]=a[j]}return u.concat(f).startWith(c)}function j(a){var b=this;return new x(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function k(a){return E(a.next)&&E(a["throw"])}function l(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:k(b.prototype):!1}function m(a){return Object==a.constructor}function n(a,b,c,d){var e=new y;return d.push(o(e,b,c)),a.apply(b,d),e.asObservable()}function o(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),g=0;d>g;g++)e[g]=arguments[g];if(E(c)){if(e=f(c).apply(b,e),e===F)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function p(a,b,c,d){var e=new y;return d.push(q(e,b,c)),a.apply(b,d),e.asObservable()}function q(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,g=[],h=1;e>h;h++)g[h-1]=arguments[h];if(E(c)){var g=f(c).apply(b,g);if(g===F)return a.onError(g.e);a.onNext(g)}else g.length<=1?a.onNext(g[0]):a.onNext(g);a.onCompleted()}}function r(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function s(a,b,c){var d=new A,e=Object.prototype.toString;if("[object NodeList]"===e.call(a)||"[object HTMLCollection]"===e.call(a))for(var f=0,g=a.length;g>f;f++)d.add(s(a.item(f),b,c));else a&&d.add(new r(a,b,c));return d}var t,u=c.Observable,v=(u.prototype,u.fromPromise),w=u.throwError,x=c.AnonymousObservable,y=c.AsyncSubject,z=c.Disposable.create,A=c.CompositeDisposable,B=(c.Scheduler.immediate,c.Scheduler["default"]),C=c.Scheduler.isScheduler,D=c.helpers.isPromise,E=c.helpers.isFunction,F={e:{}},G=u.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new x(function(d){function e(b){var c=f(a.next).call(a,b);return c===F?d.onError(c.e):void i(c)}function h(b){var c=f(a.next).call(a,b);return c===F?d.onError(c.e):void i(c)}function i(a){a.done&&(d.onNext(a.value),d.onCompleted());var c=g.call(b,a.value);u.isObservable(c)?j.add(c.subscribe(e,h)):h(new TypeError("type not supported"))}var j=new A;return E(a)&&(a=a.apply(b,c)),a&&E(a.next)?(e(),j):(d.onNext(a),d.onCompleted())})};u.start=function(a,b,c){return H(a,b,c)()};var H=u.toAsync=function(a,b,c){return C(c)||(c=B),function(){var d=arguments,e=new y;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};u.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return n(a,b,c,e)}},u.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return p(a,b,c,e)}},r.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},c.config.useNativeEvents=!1,u.fromEvent=function(a,b,d){function e(a){return function(){var b=arguments[0];return E(d)&&(b=f(d).apply(null,arguments),b===F)?a.onError(b.e):void a.onNext(b)}}return a.addListener?I(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new x(function(c){return s(a,b,e(c))}).publish().refCount():I(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var I=u.fromEventPattern=function(a,b,c){return new x(function(d){function e(){var a=arguments[0];return E(c)&&(a=f(c).apply(null,arguments),a===F)?d.onError(a.e):void d.onNext(a)}var g=a(e);return z(function(){E(b)&&b(e,g)})}).publish().refCount()};return u.startAsync=function(a){var b;try{b=a()}catch(c){return w(c)}return v(b)},c});
//# sourceMappingURL=rx.async.map