rx-lite-extras
Advanced tools
Comparing version 2.5.2 to 3.0.0
@@ -5,3 +5,3 @@ { | ||
"description": "Lightweight library extras for composing asynchronous and event-based operations in JavaScript", | ||
"version": "2.5.2", | ||
"version": "3.0.0", | ||
"homepage": "https://github.com/Reactive-Extensions/RxJS", | ||
@@ -8,0 +8,0 @@ "author": { |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. | ||
;(function (factory) { | ||
var objectTypes = { | ||
'boolean': false, | ||
'function': true, | ||
'object': true, | ||
'number': false, | ||
'string': false, | ||
'undefined': false | ||
}; | ||
var objectTypes = { | ||
'function': true, | ||
'object': true | ||
}; | ||
var root = (objectTypes[typeof window] && window) || this, | ||
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, | ||
freeModule = objectTypes[typeof module] && module && !module.nodeType && module, | ||
moduleExports = freeModule && freeModule.exports === freeExports && freeExports, | ||
freeGlobal = objectTypes[typeof global] && global; | ||
var | ||
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, | ||
freeSelf = objectTypes[typeof self] && self.Object && self, | ||
freeWindow = objectTypes[typeof window] && window && window.Object && window, | ||
freeModule = objectTypes[typeof module] && module && !module.nodeType && module, | ||
moduleExports = freeModule && freeModule.exports === freeExports && freeExports, | ||
freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; | ||
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { | ||
root = freeGlobal; | ||
} | ||
var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; | ||
// Because of build optimizers | ||
if (typeof define === 'function' && define.amd) { | ||
define(['rx-lite'], function (Rx, exports) { | ||
return factory(root, exports, Rx); | ||
}); | ||
} else if (typeof module === 'object' && module && module.exports === freeExports) { | ||
module.exports = factory(root, module.exports, require('rx-lite')); | ||
} else { | ||
root.Rx = factory(root, {}, root.Rx); | ||
} | ||
// Because of build optimizers | ||
if (typeof define === 'function' && define.amd) { | ||
define(['rx-lite'], function (Rx, exports) { | ||
return factory(root, exports, Rx); | ||
}); | ||
} else if (typeof module === 'object' && module && module.exports === freeExports) { | ||
module.exports = factory(root, module.exports, require('rx-lite')); | ||
} else { | ||
root.Rx = factory(root, {}, root.Rx); | ||
} | ||
}.call(this, function (root, exp, Rx, undefined) { | ||
@@ -39,3 +35,3 @@ | ||
observableNever = Observable.never, | ||
observableThrow = Observable.throwException, | ||
observableThrow = Observable['throw'], | ||
AnonymousObservable = Rx.AnonymousObservable, | ||
@@ -47,2 +43,3 @@ AnonymousObserver = Rx.AnonymousObserver, | ||
Observer = Rx.Observer, | ||
observerCreate = Observer.create, | ||
Subject = Rx.Subject, | ||
@@ -62,2 +59,3 @@ internals = Rx.internals, | ||
isPromise = helpers.isPromise, | ||
isFunction = helpers.isFunction, | ||
inherits = internals.inherits, | ||
@@ -70,2 +68,21 @@ bindCallback = internals.bindCallback, | ||
var errorObj = {e: {}}; | ||
var tryCatchTarget; | ||
function tryCatcher() { | ||
try { | ||
return tryCatchTarget.apply(this, arguments); | ||
} catch (e) { | ||
errorObj.e = e; | ||
return errorObj; | ||
} | ||
} | ||
function tryCatch(fn) { | ||
if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } | ||
tryCatchTarget = fn; | ||
return tryCatcher; | ||
} | ||
function thrower(e) { | ||
throw e; | ||
} | ||
function ScheduledDisposable(scheduler, disposable) { | ||
@@ -301,12 +318,14 @@ this.scheduler = scheduler; | ||
Observable.using = function (resourceFactory, observableFactory) { | ||
return new AnonymousObservable(function (observer) { | ||
var disposable = disposableEmpty, resource, source; | ||
try { | ||
resource = resourceFactory(); | ||
resource && (disposable = resource); | ||
source = observableFactory(resource); | ||
} catch (exception) { | ||
return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable); | ||
return new AnonymousObservable(function (o) { | ||
var disposable = disposableEmpty; | ||
var resource = tryCatch(resourceFactory)(); | ||
if (resource === errorObj) { | ||
return new CompositeDisposable(observableThrow(resource.e).subscribe(o), disposable); | ||
} | ||
return new CompositeDisposable(source.subscribe(observer), disposable); | ||
resource && (disposable = resource); | ||
var source = tryCatch(observableFactory)(resource); | ||
if (source === errorObj) { | ||
return new CompositeDisposable(observableThrow(source.e).subscribe(o), disposable); | ||
} | ||
return new CompositeDisposable(source.subscribe(o), disposable); | ||
}); | ||
@@ -344,35 +363,33 @@ }; | ||
leftSubscription.setDisposable(leftSource.subscribe(function (left) { | ||
choiceL(); | ||
if (choice === leftChoice) { | ||
observer.onNext(left); | ||
var leftSubscribe = observerCreate( | ||
function (left) { | ||
choiceL(); | ||
choice === leftChoice && observer.onNext(left); | ||
}, | ||
function (e) { | ||
choiceL(); | ||
choice === leftChoice && observer.onError(e); | ||
}, | ||
function () { | ||
choiceL(); | ||
choice === leftChoice && observer.onCompleted(); | ||
} | ||
}, function (err) { | ||
choiceL(); | ||
if (choice === leftChoice) { | ||
observer.onError(err); | ||
); | ||
var rightSubscribe = observerCreate( | ||
function (right) { | ||
choiceR(); | ||
choice === rightChoice && observer.onNext(right); | ||
}, | ||
function (e) { | ||
choiceR(); | ||
choice === rightChoice && observer.onError(e); | ||
}, | ||
function () { | ||
choiceR(); | ||
choice === rightChoice && observer.onCompleted(); | ||
} | ||
}, function () { | ||
choiceL(); | ||
if (choice === leftChoice) { | ||
observer.onCompleted(); | ||
} | ||
})); | ||
); | ||
rightSubscription.setDisposable(rightSource.subscribe(function (right) { | ||
choiceR(); | ||
if (choice === rightChoice) { | ||
observer.onNext(right); | ||
} | ||
}, function (err) { | ||
choiceR(); | ||
if (choice === rightChoice) { | ||
observer.onError(err); | ||
} | ||
}, function () { | ||
choiceR(); | ||
if (choice === rightChoice) { | ||
observer.onCompleted(); | ||
} | ||
})); | ||
leftSubscription.setDisposable(leftSource.subscribe(leftSubscribe)); | ||
rightSubscription.setDisposable(rightSource.subscribe(rightSubscribe)); | ||
@@ -383,22 +400,19 @@ return new CompositeDisposable(leftSubscription, rightSubscription); | ||
function amb(p, c) { return p.amb(c); } | ||
/** | ||
* Propagates the observable sequence or Promise that reacts first. | ||
* | ||
* @example | ||
* var = Rx.Observable.amb(xs, ys, zs); | ||
* @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. | ||
*/ | ||
Observable.amb = function () { | ||
var acc = observableNever(), items = []; | ||
var acc = observableNever(), items; | ||
if (Array.isArray(arguments[0])) { | ||
items = arguments[0]; | ||
} else { | ||
for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); } | ||
var len = arguments.length; | ||
items = new Array(items); | ||
for(var i = 0; i < len; i++) { items[i] = arguments[i]; } | ||
} | ||
function func(previous, current) { | ||
return previous.amb(current); | ||
} | ||
for (var i = 0, len = items.length; i < len; i++) { | ||
acc = func(acc, items[i]); | ||
acc = amb(acc, items[i]); | ||
} | ||
@@ -451,8 +465,7 @@ return acc; | ||
function toArray(x) { return x.toArray(); } | ||
function notEmpty(x) { return x.length > 0; } | ||
/** | ||
* Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. | ||
* | ||
* @example | ||
* var res = xs.bufferWithCount(10); | ||
* var res = xs.bufferWithCount(10, 1); | ||
* @param {Number} count Length of each buffer. | ||
@@ -463,10 +476,6 @@ * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. | ||
observableProto.bufferWithCount = function (count, skip) { | ||
if (typeof skip !== 'number') { | ||
skip = count; | ||
} | ||
return this.windowWithCount(count, skip).selectMany(function (x) { | ||
return x.toArray(); | ||
}).where(function (x) { | ||
return x.length > 0; | ||
}); | ||
typeof skip !== 'number' && (skip = count); | ||
return this.windowWithCount(count, skip) | ||
.flatMap(toArray) | ||
.filter(notEmpty); | ||
}; | ||
@@ -629,3 +638,24 @@ | ||
/** | ||
* Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence | ||
* can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`) | ||
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source. | ||
*/ | ||
observableProto.singleInstance = function() { | ||
var source = this, hasObservable = false, observable; | ||
function getObservable() { | ||
if (!hasObservable) { | ||
hasObservable = true; | ||
observable = source.finally(function() { hasObservable = false; }).publish().refCount(); | ||
} | ||
return observable; | ||
}; | ||
return new AnonymousObservable(function(o) { | ||
return getObservable().subscribe(o); | ||
}); | ||
}; | ||
return Rx; | ||
})); |
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/ | ||
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx-lite"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("rx-lite")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function f(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function h(a){this.comparer=a,this.set=[]}var i=c.Observable,j=i.prototype,k=i.never,l=i.throwException,m=c.AnonymousObservable,n=c.AnonymousObserver,o=c.Notification.createOnNext,p=c.Notification.createOnError,q=c.Notification.createOnCompleted,r=c.Observer,s=c.Subject,t=c.internals,u=c.helpers,v=t.ScheduledObserver,w=c.SerialDisposable,x=c.SingleAssignmentDisposable,y=c.CompositeDisposable,z=c.RefCountDisposable,A=c.Disposable.empty,B=c.Scheduler.immediate,C=(u.defaultKeySerializer,c.internals.addRef),D=(u.identity,u.isPromise),E=t.inherits,F=t.bindCallback,G=(u.noop,c.Scheduler.isScheduler),H=i.fromPromise,I=c.ArgumentOutOfRangeError;e.prototype.dispose=function(){this.scheduler.scheduleWithState(this,f)};var J=function(a){function b(b){a.call(this),this._observer=b,this._state=0}E(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=tryCatch(this._observer.onNext).call(this._observer,a);this._state=0,b===errorObj&&thrower(b.e)},c.onError=function(a){this.checkAccess();var b=tryCatch(this._observer.onError).call(this._observer,a);this._state=2,b===errorObj&&thrower(b.e)},c.onCompleted=function(){this.checkAccess();var a=tryCatch(this._observer.onCompleted).call(this._observer);this._state=2,a===errorObj&&thrower(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(r),K=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return E(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(v);r.prototype.checked=function(){return new J(this)},r.notifyOn=function(a){return new K(a,this)},r.fromNotifier=function(a,b){var c=F(a,b,1);return new n(function(a){return c(o(a))},function(a){return c(p(a))},function(){return c(q())})},r.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},r.prototype.asObserver=function(){var a=this;return new n(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new K(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new x,f=new w;return f.setDisposable(d),d.setDisposable(a.schedule(function(){f.setDisposable(new e(a,b.subscribe(c)))})),f},b)},i.generate=function(a,b,c,d,e){return G(e)||(e=currentThreadScheduler),new m(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=A;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new y(l(g).subscribe(c),f)}return new y(e.subscribe(c),f)})},j.amb=function(a){var b=this;return new m(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new x,j=new x;return D(a)&&(a=H(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new y(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}var b=k(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return L([this,a])};var L=i.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new m(function(b){var c=0,d=new w,e=B.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],D(f)&&(f=H(f)),g=new x,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new y(d,e)})};return j.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},j.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new I;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new I;return new m(function(d){function e(){var a=new s;i.push(a),d.onNext(C(a,g))}var f=new x,g=new z(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},j.takeLastBuffer=function(a){var b=this;return new m(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},j.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new m(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},h.prototype.push=function(a){var b=-1===g(this.set,a,this.comparer);return b&&this.set.push(a),b},j.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new m(function(d){var e=new h(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},c}); | ||
(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 o.apply(this,arguments)}catch(a){return S.e=a,S}}function f(a){if(!M(a))throw new TypeError("fn must be a function");return o=a,e}function g(a){throw a}function h(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function i(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function j(a,b){return a.amb(b)}function k(a){return a.toArray()}function l(a){return a.length>0}function m(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function n(a){this.comparer=a,this.set=[]}var o,p=c.Observable,q=p.prototype,r=p.never,s=p["throw"],t=c.AnonymousObservable,u=c.AnonymousObserver,v=c.Notification.createOnNext,w=c.Notification.createOnError,x=c.Notification.createOnCompleted,y=c.Observer,z=y.create,A=c.Subject,B=c.internals,C=c.helpers,D=B.ScheduledObserver,E=c.SerialDisposable,F=c.SingleAssignmentDisposable,G=c.CompositeDisposable,H=c.RefCountDisposable,I=c.Disposable.empty,J=c.Scheduler.immediate,K=(C.defaultKeySerializer,c.internals.addRef),L=(C.identity,C.isPromise),M=C.isFunction,N=B.inherits,O=B.bindCallback,P=(C.noop,c.Scheduler.isScheduler),Q=p.fromPromise,R=c.ArgumentOutOfRangeError,S={e:{}};h.prototype.dispose=function(){this.scheduler.scheduleWithState(this,i)};var T=function(a){function b(b){a.call(this),this._observer=b,this._state=0}N(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=f(this._observer.onNext).call(this._observer,a);this._state=0,b===S&&g(b.e)},c.onError=function(a){this.checkAccess();var b=f(this._observer.onError).call(this._observer,a);this._state=2,b===S&&g(b.e)},c.onCompleted=function(){this.checkAccess();var a=f(this._observer.onCompleted).call(this._observer);this._state=2,a===S&&g(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(y),U=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return N(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(D);y.prototype.checked=function(){return new T(this)},y.notifyOn=function(a){return new U(a,this)},y.fromNotifier=function(a,b){var c=O(a,b,1);return new u(function(a){return c(v(a))},function(a){return c(w(a))},function(){return c(x())})},y.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},y.prototype.asObserver=function(){var a=this;return new u(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},q.observeOn=function(a){var b=this;return new t(function(c){return b.subscribe(new U(a,c))},b)},q.subscribeOn=function(a){var b=this;return new t(function(c){var d=new F,e=new E;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new h(a,b.subscribe(c)))})),e},b)},p.generate=function(a,b,c,d,e){return P(e)||(e=currentThreadScheduler),new t(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},p.using=function(a,b){return new t(function(c){var d=I,e=f(a)();if(e===S)return new G(s(e.e).subscribe(c),d);e&&(d=e);var g=f(b)(e);return g===S?new G(s(g.e).subscribe(c),d):new G(g.subscribe(c),d)})},q.amb=function(a){var b=this;return new t(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new F,j=new F;L(a)&&(a=Q(a));var k=z(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=z(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new G(i,j)})},p.amb=function(){var a,b=r();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=j(b,a[d]);return b},q.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return V([this,a])};var V=p.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new t(function(b){var c=0,d=new E,e=J.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],L(f)&&(f=Q(f)),g=new F,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new G(d,e)})};return q.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(k).filter(l)},q.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new R;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new R;return new t(function(d){function e(){var a=new A;i.push(a),d.onNext(K(a,g))}var f=new F,g=new H(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},q.takeLastBuffer=function(a){var b=this;return new t(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},q.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new t(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},n.prototype.push=function(a){var b=-1===m(this.set,a,this.comparer);return b&&this.set.push(a),b},q.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new t(function(d){var e=new n(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},q.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new t(function(b){return a().subscribe(b)})},c}); | ||
//# sourceMappingURL=rx.lite.extras.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47890
616