Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/bcaefe5fdf0b8a9f4e1300a1d7d7ad0019c442d618b35548583919463ca29965.json

1 line
7.7 KiB
JSON
Raw Normal View History

2024-10-31 19:07:58 +00:00
{"ast":null,"code":"import { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { defaultThrottleConfig } from './throttle';\nexport function throttleTime(duration, scheduler = async, config = defaultThrottleConfig) {\n return source => source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));\n}\nclass ThrottleTimeOperator {\n constructor(duration, scheduler, leading, trailing) {\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n }\n call(subscriber, source) {\n return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));\n }\n}\nclass ThrottleTimeSubscriber extends Subscriber {\n constructor(destination, duration, scheduler, leading, trailing) {\n super(destination);\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n this._hasTrailingValue = false;\n this._trailingValue = null;\n }\n _next(value) {\n if (this.throttled) {\n if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n } else {\n this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, {\n subscriber: this\n }));\n if (this.leading) {\n this.destination.next(value);\n } else if (this.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n }\n }\n _complete() {\n if (this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this.destination.complete();\n } else {\n this.destination.complete();\n }\n }\n clearThrottle() {\n const throttled = this.throttled;\n if (throttled) {\n if (this.trailing && this._hasTrailingValue) {\n this.destination.next(this._trailingValue);\n this._trailingValue = null;\n this._hasTrailingValue = false;\n }\n throttled.unsubscribe();\n this.remove(throttled);\n this.throttled = null;\n }\n }\n}\nfunction dispatchNext(arg) {\n const {\n subscriber\n } = arg;\n subscriber.clearThrottle();\n}","map":{"version":3,"names":["Subscriber","async","defaultThrottleConfig","throttleTime","duration","scheduler","config","source","lift","ThrottleTimeOperator","leading","trailing","constructor","call","subscriber","subscribe","ThrottleTimeSubscriber","destination","_hasTrailingValue","_trailingValue","_next","value","throttled","add","schedule","dispatchNext","next","_complete","complete","clearThrottle","unsubscribe","remove","arg"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/throttleTime.js"],"sourcesContent":["import { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nimport { defaultThrottleConfig } from './throttle';\nexport function throttleTime(duration, scheduler = async, config = defaultThrottleConfig) {\n return (source) => source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));\n}\nclass ThrottleTimeOperator {\n constructor(duration, scheduler, leading, trailing) {\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n }\n call(subscriber, source) {\n return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));\n }\n}\nclass ThrottleTimeSubscriber extends Subscriber {\n constructor(destination, duration, scheduler, leading, trailing) {\n super(destination);\n this.duration = duration;\n this.scheduler = scheduler;\n this.leading = leading;\n this.trailing = trailing;\n this._hasTrailingValue = false;\n this._trailingValue = null;\n }\n _next(value) {\n if (this.throttled) {\n if (this.t