1 line
6.3 KiB
JSON
1 line
6.3 KiB
JSON
{"ast":null,"code":"import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function debounce(durationSelector) {\n return source => source.lift(new DebounceOperator(durationSelector));\n}\n\nclass DebounceOperator {\n constructor(durationSelector) {\n this.durationSelector = durationSelector;\n }\n\n call(subscriber, source) {\n return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));\n }\n\n}\n\nclass DebounceSubscriber extends SimpleOuterSubscriber {\n constructor(destination, durationSelector) {\n super(destination);\n this.durationSelector = durationSelector;\n this.hasValue = false;\n }\n\n _next(value) {\n try {\n const result = this.durationSelector.call(this, value);\n\n if (result) {\n this._tryNext(value, result);\n }\n } catch (err) {\n this.destination.error(err);\n }\n }\n\n _complete() {\n this.emitValue();\n this.destination.complete();\n }\n\n _tryNext(value, duration) {\n let subscription = this.durationSubscription;\n this.value = value;\n this.hasValue = true;\n\n if (subscription) {\n subscription.unsubscribe();\n this.remove(subscription);\n }\n\n subscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n\n if (subscription && !subscription.closed) {\n this.add(this.durationSubscription = subscription);\n }\n }\n\n notifyNext() {\n this.emitValue();\n }\n\n notifyComplete() {\n this.emitValue();\n }\n\n emitValue() {\n if (this.hasValue) {\n const value = this.value;\n const subscription = this.durationSubscription;\n\n if (subscription) {\n this.durationSubscription = undefined;\n subscription.unsubscribe();\n this.remove(subscription);\n }\n\n this.value = undefined;\n this.hasValue = false;\n\n super._next(value);\n }\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":["D:/MobileDev/WRB/WrenchBoard2023a/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 }\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}\n"],"mappings":"AAAA,SAASA,qBAAT,EAAgCC,cAAhC,EAAgDC,qBAAhD,QAA6E,mBAA7E;AACA,OAAO,SAASC,QAAT,CAAkBC,gBAAlB,EAAoC;EACvC,OAAQC,MAAD,IAAYA,MAAM,CAACC,IAAP,CAAY,IAAIC,gBAAJ,CAAqBH,gBAArB,CAAZ,CAAnB;AACH;;AACD,MAAMG,gBAAN,CAAuB;EACnBC,WAAW,CAACJ,gBAAD,EAAmB;IAC1B,KAAKA,gBAAL,GAAwBA,gBAAxB;EACH;;EACDK,IAAI,CA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