Files
WrenchBoardIonic2023/.angular/cache/14.2.0/babel-webpack/c23b688fb49e81ecc7b984b022ecf07e.json
T
CHIEFSOFT\ameye cea49e295a first commit
2023-05-12 22:30:08 -04:00

1 line
7.4 KiB
JSON

{"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}\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\n call(subscriber, source) {\n return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));\n }\n\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\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\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\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\n clearThrottle() {\n const throttled = this.throttled;\n\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\n throttled.unsubscribe();\n this.remove(throttled);\n this.throttled = null;\n }\n }\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":["D:/MobileDev/WRB/WrenchBoard2023a/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.trailing) {\n this._trailingValue = value;\n this._hasTrailingValue = true;\n }\n }\n else {\n this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));\n if (this.leading) {\n this.destination.next(value);\n }\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 }\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 { subscriber } = arg;\n subscriber.clearThrottle();\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,eAA3B;AACA,SAASC,KAAT,QAAsB,oBAAtB;AACA,SAASC,qBAAT,QAAsC,YAAtC;AACA,OAAO,SAASC,YAAT,CAAsBC,QAAtB,EAAgCC,SAAS,GAAGJ,KAA5C,EAAmDK,MAAM,GAAGJ,qBAA5D,EAAmF;EACtF,OAAQK,MAAD,IAAYA,MAAM,CAACC,IAAP,CAAY,IAAIC,oBAAJ,CAAyBL,QAAzB,EAAmCC,SAAnC,EAA8CC,MAAM,CAACI,OAArD,EAA8DJ,MAAM,CAACK,QAArE,CAAZ,CAAnB;AACH;;AACD,MAAMF,oBAAN,CAA2B;EACvBG,WAAW,CAACR,QAAD,EAAWC,SAAX,EAAsBK,OAAtB,EAA+BC,QAA/B,EAAyC;IAChD,KAAKP,QAAL,GAAgBA,QAAhB;IACA,KAAKC,SAAL,GAAiBA,SAAjB;IACA,KAAKK,OAAL,GAAeA,OAAf;IACA,KAAKC,QAAL,GAAgBA,QAAhB;EACH;;EACDE,IAAI,CAACC,UAAD,EAAaP,MAAb,EAAqB;IACrB,OAAOA,MAAM,CAACQ,SAAP,CAAiB,IAAIC,sBAAJ,CAA2BF,UAA3B,EAAuC,KAAKV,QAA5C,EAAsD,KAAKC,SAA3D,EAAsE,KAAKK,OAA3E,EAAoF,KAAKC,QAAzF,CAAjB,CAAP;EACH;;AATsB;;AAW3B,MAAMK,sBAAN,SAAqChB,UAArC,CAAgD;EAC5CY,WAAW,CAACK,WAAD,EAAcb,QAAd,EAAwBC,SAAxB,EAAmCK,OAAnC,EAA4CC,QAA5C,EAAsD;IAC7D,MAAMM,WAAN;IACA,KAAKb,QAAL,GAAgBA,QAAhB;IACA,KAAKC,SAAL,GAAiBA,SAAjB;IACA,KAAKK,OAAL,GAAeA,O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