UNPKG

webappengine

Version:

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

3 lines 8.87 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.core"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx.core")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function f(){try{return i.apply(this,arguments)}catch(a){return x.e=a,x}}function g(a){if(!t(a))throw new TypeError("fn must be a function");return i=a,f}function h(a){throw a}var i,j=c.Observable,k=j.prototype,l=c.AnonymousObservable,m=c.Observer,n=c.internals.AbstractObserver,o=c.Disposable.create,p=c.Disposable.empty,q=c.CompositeDisposable,r=c.SerialDisposable,s=c.Scheduler.currentThread,t=c.helpers.isFunction,u=c.internals.inherits,v=c.internals.addProperties,w=c.Disposable.checkDisposed,x={e:{}};k.multicast=function(a,b){var c=this;return"function"==typeof a?new l(function(d){var e=c.multicast(a());return new q(b(e).subscribe(d),e.connect())},c):new F(c,a)},k.publish=function(a){return a&&t(a)?this.multicast(function(){return new A},a):this.multicast(new A)},k.share=function(){return this.publish().refCount()},k.publishLast=function(a){return a&&t(a)?this.multicast(function(){return new C},a):this.multicast(new C)},k.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new D(b)},a):this.multicast(new D(a))},k.shareValue=function(a){return this.publishValue(a).refCount()},k.replay=function(a,b,c,d){return a&&t(a)?this.multicast(function(){return new E(b,c,d)},a):this.multicast(new E(b,c,d))},k.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var y=c.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new r}return u(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=g(c)();return d===x?(a.queue=[],a.hasFaulted=!0,h(d.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(n),z=function(a,b){this.subject=a,this.observer=b};z.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var A=c.Subject=function(a){function b(a){return w(this),this.isStopped?this.hasError?(a.onError(this.error),p):(a.onCompleted(),p):(this.observers.push(a),new z(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return u(c,a),v(c.prototype,m.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(w(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(w(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(w(this),!this.isStopped)for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new B(a,b)},c}(j),B=c.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return u(c,a),v(c.prototype,m.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(j),C=c.AsyncSubject=function(a){function b(a){return w(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),p):(this.observers.push(a),new z(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return u(c,a),v(c.prototype,m,{hasObservers:function(){return w(this),this.observers.length>0},onCompleted:function(){var a,b;if(w(this),!this.isStopped){this.isStopped=!0;var c=e(this.observers),b=c.length;if(this.hasValue)for(a=0;b>a;a++){var d=c[a];d.onNext(this.value),d.onCompleted()}else for(a=0;b>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(w(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){w(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(j),D=c.BehaviorSubject=function(a){function b(a){return w(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),p):(this.observers.push(a),a.onNext(this.value),new z(this,a))}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return u(c,a),v(c.prototype,m,{getValue:function(){if(w(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(w(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(w(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(w(this),!this.isStopped){this.value=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(j),E=c.ReplaySubject=function(a){function b(a,b){return o(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(a){var c=new y(this.scheduler,a),d=b(this,c);w(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d}function d(b,d,e){this.bufferSize=null==b?f:b,this.windowSize=null==d?f:d,this.scheduler=e||s,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}var f=Math.pow(2,53)-1;return u(d,a),v(d.prototype,m.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(w(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onNext(a),g.ensureActive()}}},onError:function(a){if(w(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(w(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,c=e(this.observers),d=c.length;d>b;b++){var f=c[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),d}(j),F=c.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new q(f.subscribe(c),o(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return u(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new l(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(j);return c}); //# sourceMappingURL=rx.core.binding.map