refactor(Cypress): Moved Cypress to the main folder of the project, as I don't need a sub project for now.
This commit is contained in:
74
node_modules/rxjs/_esm5/internal/operators/debounce.js
generated
vendored
Normal file
74
node_modules/rxjs/_esm5/internal/operators/debounce.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
/** PURE_IMPORTS_START tslib,_innerSubscribe PURE_IMPORTS_END */
|
||||
import * as tslib_1 from "tslib";
|
||||
import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
|
||||
export function debounce(durationSelector) {
|
||||
return function (source) { return source.lift(new DebounceOperator(durationSelector)); };
|
||||
}
|
||||
var DebounceOperator = /*@__PURE__*/ (function () {
|
||||
function DebounceOperator(durationSelector) {
|
||||
this.durationSelector = durationSelector;
|
||||
}
|
||||
DebounceOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
|
||||
};
|
||||
return DebounceOperator;
|
||||
}());
|
||||
var DebounceSubscriber = /*@__PURE__*/ (function (_super) {
|
||||
tslib_1.__extends(DebounceSubscriber, _super);
|
||||
function DebounceSubscriber(destination, durationSelector) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.durationSelector = durationSelector;
|
||||
_this.hasValue = false;
|
||||
return _this;
|
||||
}
|
||||
DebounceSubscriber.prototype._next = function (value) {
|
||||
try {
|
||||
var result = this.durationSelector.call(this, value);
|
||||
if (result) {
|
||||
this._tryNext(value, result);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
this.destination.error(err);
|
||||
}
|
||||
};
|
||||
DebounceSubscriber.prototype._complete = function () {
|
||||
this.emitValue();
|
||||
this.destination.complete();
|
||||
};
|
||||
DebounceSubscriber.prototype._tryNext = function (value, duration) {
|
||||
var subscription = this.durationSubscription;
|
||||
this.value = value;
|
||||
this.hasValue = true;
|
||||
if (subscription) {
|
||||
subscription.unsubscribe();
|
||||
this.remove(subscription);
|
||||
}
|
||||
subscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));
|
||||
if (subscription && !subscription.closed) {
|
||||
this.add(this.durationSubscription = subscription);
|
||||
}
|
||||
};
|
||||
DebounceSubscriber.prototype.notifyNext = function () {
|
||||
this.emitValue();
|
||||
};
|
||||
DebounceSubscriber.prototype.notifyComplete = function () {
|
||||
this.emitValue();
|
||||
};
|
||||
DebounceSubscriber.prototype.emitValue = function () {
|
||||
if (this.hasValue) {
|
||||
var value = this.value;
|
||||
var subscription = this.durationSubscription;
|
||||
if (subscription) {
|
||||
this.durationSubscription = undefined;
|
||||
subscription.unsubscribe();
|
||||
this.remove(subscription);
|
||||
}
|
||||
this.value = undefined;
|
||||
this.hasValue = false;
|
||||
_super.prototype._next.call(this, value);
|
||||
}
|
||||
};
|
||||
return DebounceSubscriber;
|
||||
}(SimpleOuterSubscriber));
|
||||
//# sourceMappingURL=debounce.js.map
|
Reference in New Issue
Block a user