UNPKG

webappengine

Version:

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

3 lines 6.54 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.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 y.apply(this,arguments)}catch(a){return K.e=a,K}}function f(a){if(!J(a))throw new TypeError("fn must be a function");return y=a,e}function g(a){return a?z.isObservable(a)?a:I(a)?z.fromPromise(a):l(a)||k(a)?L.call(this,a):J(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 z.from(a).map(g,this).toArray()}function i(a){function b(a,b){c[b]=d,f.push(new C(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&&z.isObservable(k)?b(k,j):c[j]=a[j]}return z.concat(f).startWith(c)}function j(a){var b=this;return new C(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 J(a.next)&&J(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 D;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(J(c)){if(e=f(c).apply(b,e),e===K)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 D;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(J(c)){var g=f(c).apply(b,g);if(g===K)return a.onError(g.e);a.onNext(g)}else g.length<=1?a.onNext(g[0]):a.onNext(g);a.onCompleted()}}function r(a){return window.StaticNodeList?a instanceof window.StaticNodeList||a instanceof window.NodeList:"[object NodeList]"==Object.prototype.toString.call(a)}function s(b){var c=function(){this.cancelBubble=!0},d=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(b||(b=a.event),!b.target)switch(b.target=b.target||b.srcElement,"mouseover"==b.type&&(b.relatedTarget=b.fromElement),"mouseout"==b.type&&(b.relatedTarget=b.toElement),b.stopPropagation||(b.stopPropagation=c,b.preventDefault=d),b.type){case"keypress":var e="charCode"in b?b.charCode:b.keyCode;10==e?(e=0,b.keyCode=13):13==e||27==e?e=0:3==e&&(e=99),b.charCode=e,b.keyChar=b.charCode?String.fromCharCode(b.charCode):""}return b}function t(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function u(a,b,c){this._e=a,this._n="on"+b,this._fn=function(a){c(s(a))},this._e.attachEvent(this._n,this._fn),this.isDisposed=!1}function v(a,b,c){this._e=a,this._n="on"+b,this._e[this._n]=c,this.isDisposed=!1}function w(a,b,c){return a.addEventListener?new t(a,b,c):a.attachEvent?new u(a,b,c):v(a,b,c)}function x(a,b,c){var d=new F;if(r(a)||"[object HTMLCollection]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(x(a.item(e),b,c));else a&&d.add(w(a,b,c));return d}var y,z=c.Observable,A=(z.prototype,z.fromPromise),B=z.throwError,C=c.AnonymousObservable,D=c.AsyncSubject,E=c.Disposable.create,F=c.CompositeDisposable,G=(c.Scheduler.immediate,c.Scheduler["default"]),H=c.Scheduler.isScheduler,I=c.helpers.isPromise,J=c.helpers.isFunction,K={e:{}},L=z.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new C(function(d){function e(b){var c=f(a.next).call(a,b);return c===K?d.onError(c.e):void i(c)}function h(b){var c=f(a.next).call(a,b);return c===K?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);z.isObservable(c)?j.add(c.subscribe(e,h)):h(new TypeError("type not supported"))}var j=new F;return J(a)&&(a=a.apply(b,c)),a&&J(a.next)?(e(),j):(d.onNext(a),d.onCompleted())})};z.start=function(a,b,c){return M(a,b,c)()};var M=z.toAsync=function(a,b,c){return H(c)||(c=G),function(){var d=arguments,e=new D;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()}};z.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)}},z.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)}},t.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},u.prototype.dispose=function(){this.isDisposed||(this._e.detachEvent(this._n,this._fn),this.isDisposed=!0)},v.prototype.dispose=function(){this.isDisposed||(this._e[this._n]=null,this.isDisposed=!0)},c.config.useNativeEvents=!1,z.fromEvent=function(a,b,d){return a.addListener?N(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 C(function(c){return x(a,b,function(){var a=arguments[0];return J(d)&&(a=f(d).apply(null,arguments),a===K)?c.onError(a.e):void c.onNext(a)})}).publish().refCount():N(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var N=z.fromEventPattern=function(a,b,c){return new C(function(d){function e(){var a=arguments[0];return J(c)&&(a=f(c).apply(null,arguments),a===K)?d.onError(a.e):void d.onNext(a)}var g=a(e);return E(function(){J(b)&&b(e,g)})}).publish().refCount()};return z.startAsync=function(a){var b;try{b=a()}catch(c){return B(c)}return A(b)},c}); //# sourceMappingURL=rx.async.compat.map