UNPKG

webappengine

Version:

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

3 lines 7.67 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-lite"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("rx-lite")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(){try{return h.apply(this,arguments)}catch(a){return A.e=a,A}}function f(a){if(!x(a))throw new TypeError("fn must be a function");return h=a,e}function g(a){return a.toArray()}function g(a){return a.toArray()}var h,i=c.Observable,j=i.prototype,k=c.AnonymousObservable,l=i.defer,m=(i.empty,i.never),n=i["throw"],o=(i.fromArray,c.Scheduler["default"]),p=c.SingleAssignmentDisposable,q=c.SerialDisposable,r=c.CompositeDisposable,s=c.RefCountDisposable,t=c.Subject,u=c.internals.addRef,v=(c.Scheduler.normalize,c.helpers),w=v.isPromise,x=v.isFunction,y=c.Scheduler.isScheduler,z=i.fromPromise,A={e:{}};return j.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),y(c)||(c=o),"number"==typeof b?d=b:y(b)&&(d=a,c=b),new k(function(b){function f(){var a=new p,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new t;k.push(a),b.onNext(u(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new q,m=0;return g=new r(l),h=new s(g),k.push(new t),b.onNext(u(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},j.windowWithTimeOrCount=function(a,b,c){var d=this;return y(c)||(c=o),new k(function(e){function f(b){var d=new p;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new t,e.onNext(u(l,i)),f(a)}}))}var g=new q,h=new r(g),i=new s(h),j=0,k=0,l=new t;return e.onNext(u(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new t,e.onNext(u(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},j.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(g)},j.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(g)},j.timeInterval=function(a){var b=this;return y(a)||(a=o),l(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},i.generateWithAbsoluteTime=function(a,b,c,d,e,f){return y(f)||(f=o),new k(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithAbsoluteAndState(a,f.now(),function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},i.generateWithRelativeTime=function(a,b,c,d,e,f){return y(f)||(f=o),new k(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithRelativeAndState(a,0,function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},j.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return y(b)||(b=o),new k(function(e){var f=new q;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},j.delayWithSelector=function(a,b){var c,d,e=this;return x(a)?d=a:(c=a,d=b),new k(function(a){function b(){j.setDisposable(e.subscribe(function(b){var c=f(d)(b);if(c===A)return a.onError(c.e);var e=new p;h.add(e),e.setDisposable(c.subscribe(function(){a.onNext(b),h.remove(e),g()},function(b){a.onError(b)},function(){a.onNext(b),h.remove(e),g()}))},function(b){a.onError(b)},function(){i=!0,j.dispose(),g()}))}function g(){i&&0===h.length&&a.onCompleted()}var h=new r,i=!1,j=new q;return c?j.setDisposable(c.subscribe(b,function(b){a.onError(b)},b)):b(),new r(j,h)},this)},j.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=m()),c||(c=n(new Error("Timeout")));var d=this;return new k(function(e){function f(a){function b(){return k===d}var d=k,f=new p;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new q,i=new q,j=new p;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(w(c)?z(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new r(h,i)},d)},j.debounceWithSelector=function(a){var b=this;return new k(function(c){var d,e=!1,g=new q,h=0,i=b.subscribe(function(b){var i=f(a)(b);if(i===A)return c.onError(i.e);w(i)&&(i=z(i)),e=!0,d=b,h++;var j=h,k=new p;g.setDisposable(k),k.setDisposable(i.subscribe(function(){e&&h===j&&c.onNext(d),e=!1,k.dispose()},function(a){c.onError(a)},function(){e&&h===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){g.dispose(),c.onError(a),e=!1,h++},function(){g.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,h++});return new r(i,g)},b)},j.skipLastWithTime=function(a,b){y(b)||(b=o);var c=this;return new k(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},j.takeLastWithTime=function(a,b){var c=this;return y(b)||(b=o),new k(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},j.takeLastBufferWithTime=function(a,b){var c=this;return y(b)||(b=o),new k(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},j.takeWithTime=function(a,b){var c=this;return y(b)||(b=o),new k(function(d){return new r(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},j.skipWithTime=function(a,b){var c=this;return y(b)||(b=o),new k(function(d){var e=!1;return new r(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},j.skipUntilWithTime=function(a,b){y(b)||(b=o);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new k(function(e){var f=!1;return new r(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},j.takeUntilWithTime=function(a,b){y(b)||(b=o);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new k(function(e){return new r(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},c}); //# sourceMappingURL=rx.lite.time.map