-/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
+/** PURE_IMPORTS_START tslib,_innerSubscribe PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
-import { OuterSubscriber } from '../OuterSubscriber';
-import { subscribeToResult } from '../util/subscribeToResult';
+import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
export var defaultThrottleConfig = {
leading: true,
trailing: false
if (config === void 0) {
config = defaultThrottleConfig;
}
- return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };
+ return function (source) { return source.lift(new ThrottleOperator(durationSelector, !!config.leading, !!config.trailing)); };
}
var ThrottleOperator = /*@__PURE__*/ (function () {
function ThrottleOperator(durationSelector, leading, trailing) {
this.throttle(_sendValue);
}
this._hasValue = false;
- this._sendValue = null;
+ this._sendValue = undefined;
};
ThrottleSubscriber.prototype.throttle = function (value) {
var duration = this.tryDurationSelector(value);
if (!!duration) {
- this.add(this._throttled = subscribeToResult(this, duration));
+ this.add(this._throttled = innerSubscribe(duration, new SimpleInnerSubscriber(this)));
}
};
ThrottleSubscriber.prototype.tryDurationSelector = function (value) {
if (_throttled) {
_throttled.unsubscribe();
}
- this._throttled = null;
+ this._throttled = undefined;
if (_trailing) {
this.send();
}
};
- ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
+ ThrottleSubscriber.prototype.notifyNext = function () {
this.throttlingDone();
};
ThrottleSubscriber.prototype.notifyComplete = function () {
this.throttlingDone();
};
return ThrottleSubscriber;
-}(OuterSubscriber));
+}(SimpleOuterSubscriber));
//# sourceMappingURL=throttle.js.map