1 line
5.5 KiB
JSON
1 line
5.5 KiB
JSON
{"ast":null,"code":"import { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nexport function debounceTime(dueTime, scheduler = async) {\n return source => source.lift(new DebounceTimeOperator(dueTime, scheduler));\n}\n\nclass DebounceTimeOperator {\n constructor(dueTime, scheduler) {\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n }\n\n call(subscriber, source) {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n }\n\n}\n\nclass DebounceTimeSubscriber extends Subscriber {\n constructor(destination, dueTime, scheduler) {\n super(destination);\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n this.debouncedSubscription = null;\n this.lastValue = null;\n this.hasValue = false;\n }\n\n _next(value) {\n this.clearDebounce();\n this.lastValue = value;\n this.hasValue = true;\n this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));\n }\n\n _complete() {\n this.debouncedNext();\n this.destination.complete();\n }\n\n debouncedNext() {\n this.clearDebounce();\n\n if (this.hasValue) {\n const {\n lastValue\n } = this;\n this.lastValue = null;\n this.hasValue = false;\n this.destination.next(lastValue);\n }\n }\n\n clearDebounce() {\n const debouncedSubscription = this.debouncedSubscription;\n\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n }\n\n}\n\nfunction dispatchNext(subscriber) {\n subscriber.debouncedNext();\n}","map":{"version":3,"names":["Subscriber","async","debounceTime","dueTime","scheduler","source","lift","DebounceTimeOperator","constructor","call","subscriber","subscribe","DebounceTimeSubscriber","destination","debouncedSubscription","lastValue","hasValue","_next","value","clearDebounce","add","schedule","dispatchNext","_complete","debouncedNext","complete","next","remove","unsubscribe"],"sources":["D:/MobileDev/WRB/WrenchBoard2023a/node_modules/rxjs/_esm2015/internal/operators/debounceTime.js"],"sourcesContent":["import { Subscriber } from '../Subscriber';\nimport { async } from '../scheduler/async';\nexport function debounceTime(dueTime, scheduler = async) {\n return (source) => source.lift(new DebounceTimeOperator(dueTime, scheduler));\n}\nclass DebounceTimeOperator {\n constructor(dueTime, scheduler) {\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n }\n call(subscriber, source) {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n }\n}\nclass DebounceTimeSubscriber extends Subscriber {\n constructor(destination, dueTime, scheduler) {\n super(destination);\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n this.debouncedSubscription = null;\n this.lastValue = null;\n this.hasValue = false;\n }\n _next(value) {\n this.clearDebounce();\n this.lastValue = value;\n this.hasValue = true;\n this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));\n }\n _complete() {\n this.debouncedNext();\n this.destination.complete();\n }\n debouncedNext() {\n this.clearDebounce();\n if (this.hasValue) {\n const { lastValue } = this;\n this.lastValue = null;\n this.hasValue = false;\n this.destination.next(lastValue);\n }\n }\n clearDebounce() {\n const debouncedSubscription = this.debouncedSubscription;\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n }\n}\nfunction dispatchNext(subscriber) {\n subscriber.debouncedNext();\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,eAA3B;AACA,SAASC,KAAT,QAAsB,oBAAtB;AACA,OAAO,SAASC,YAAT,CAAsBC,OAAtB,EAA+BC,SAAS,GAAGH,KAA3C,EAAkD;EACrD,OAAQI,MAAD,IAAYA,MAAM,CAACC,IAAP,CAAY,IAAIC,oBAAJ,CAAyBJ,OAAzB,EAAkCC,SAAlC,CAAZ,CAAnB;AACH;;AACD,MAAMG,oBAAN,CAA2B;EACvBC,WAAW,CAACL,OAAD,EAAUC,SAAV,EAAqB;IAC5B,KAAKD,OAAL,GAAeA,OAAf;IACA,KAAKC,SAAL,GAAiBA,SAAjB;EACH;;EACDK,IAAI,CAACC,UAAD,EAAaL,MAAb,EAA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