1 line
6.5 KiB
JSON
1 line
6.5 KiB
JSON
|
{"ast":null,"code":"import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function debounce(durationSelector) {\n return source => source.lift(new DebounceOperator(durationSelector));\n}\nclass DebounceOperator {\n constructor(durationSelector) {\n this.durationSelector = durationSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));\n }\n}\nclass DebounceSubscriber extends SimpleOuterSubscriber {\n constructor(destination, durationSelector) {\n super(destination);\n this.durationSelector = durationSelector;\n this.hasValue = false;\n }\n _next(value) {\n try {\n const result = this.durationSelector.call(this, value);\n if (result) {\n this._tryNext(value, result);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n _complete() {\n this.emitValue();\n this.destination.complete();\n }\n _tryNext(value, duration) {\n let subscription = this.durationSubscription;\n this.value = value;\n this.hasValue = true;\n if (subscription) {\n subscription.unsubscribe();\n this.remove(subscription);\n }\n subscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n if (subscription && !subscription.closed) {\n this.add(this.durationSubscription = subscription);\n }\n }\n notifyNext() {\n this.emitValue();\n }\n notifyComplete() {\n this.emitValue();\n }\n emitValue() {\n if (this.hasValue) {\n const value = this.value;\n const subscription = this.durationSubscription;\n if (subscription) {\n this.durationSubscription = undefined;\n subscription.unsubscribe();\n this.remove(subscription);\n }\n this.value = undefined;\n this.hasValue = false;\n super._next(value);\n }\n }\n}","map":{"version":3,"names":["SimpleOuterSubscriber","innerSubscribe","SimpleInnerSubscriber","debounce","durationSelector","source","lift","DebounceOperator","constructor","call","subscriber","subscribe","DebounceSubscriber","destination","hasValue","_next","value","result","_tryNext","err","error","_complete","emitValue","complete","duration","subscription","durationSubscription","unsubscribe","remove","closed","add","notifyNext","notifyComplete","undefined"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/debounce.js"],"sourcesContent":["import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function debounce(durationSelector) {\n return (source) => source.lift(new DebounceOperator(durationSelector));\n}\nclass DebounceOperator {\n constructor(durationSelector) {\n this.durationSelector = durationSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));\n }\n}\nclass DebounceSubscriber extends SimpleOuterSubscriber {\n constructor(destination, durationSelector) {\n super(destination);\n this.durationSelector = durationSelector;\n this.hasValue = false;\n }\n _next(value) {\n try {\n const result = this.durationSelector.call(this, value);\n if (result) {\n this._tryNext(value, result);\n }\n }\n catch (err) {\n this.destination.error(err);\n }\n }\n _complete() {\n this.emitValue();\n this.destination.complete();\n }\n _tryNext(value, duration) {\n let subscription = this.durationSubscription;\n this.value = value;\n this.hasValue = true;\n if (subscription) {\n subscription.unsubscribe();\n this.remove(subscription);\n }\n subscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n if (subscription && !subscription.closed) {\n this.add(this.durationSubscription = subscription);\n
|