1 line
6 KiB
JSON
1 line
6 KiB
JSON
|
{"ast":null,"code":"import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function audit(durationSelector) {\n return function auditOperatorFunction(source) {\n return source.lift(new AuditOperator(durationSelector));\n };\n}\nclass AuditOperator {\n constructor(durationSelector) {\n this.durationSelector = durationSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));\n }\n}\nclass AuditSubscriber extends SimpleOuterSubscriber {\n constructor(destination, durationSelector) {\n super(destination);\n this.durationSelector = durationSelector;\n this.hasValue = false;\n }\n _next(value) {\n this.value = value;\n this.hasValue = true;\n if (!this.throttled) {\n let duration;\n try {\n const {\n durationSelector\n } = this;\n duration = durationSelector(value);\n } catch (err) {\n return this.destination.error(err);\n }\n const innerSubscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n if (!innerSubscription || innerSubscription.closed) {\n this.clearThrottle();\n } else {\n this.add(this.throttled = innerSubscription);\n }\n }\n }\n clearThrottle() {\n const {\n value,\n hasValue,\n throttled\n } = this;\n if (throttled) {\n this.remove(throttled);\n this.throttled = undefined;\n throttled.unsubscribe();\n }\n if (hasValue) {\n this.value = undefined;\n this.hasValue = false;\n this.destination.next(value);\n }\n }\n notifyNext() {\n this.clearThrottle();\n }\n notifyComplete() {\n this.clearThrottle();\n }\n}","map":{"version":3,"names":["SimpleOuterSubscriber","innerSubscribe","SimpleInnerSubscriber","audit","durationSelector","auditOperatorFunction","source","lift","AuditOperator","constructor","call","subscriber","subscribe","AuditSubscriber","destination","hasValue","_next","value","throttled","duration","err","error","innerSubscription","closed","clearThrottle","add","remove","undefined","unsubscribe","next","notifyNext","notifyComplete"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/audit.js"],"sourcesContent":["import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function audit(durationSelector) {\n return function auditOperatorFunction(source) {\n return source.lift(new AuditOperator(durationSelector));\n };\n}\nclass AuditOperator {\n constructor(durationSelector) {\n this.durationSelector = durationSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));\n }\n}\nclass AuditSubscriber extends SimpleOuterSubscriber {\n constructor(destination, durationSelector) {\n super(destination);\n this.durationSelector = durationSelector;\n this.hasValue = false;\n }\n _next(value) {\n this.value = value;\n this.hasValue = true;\n if (!this.throttled) {\n let duration;\n try {\n const { durationSelector } = this;\n duration = durationSelector(value);\n }\n catch (err) {\n return this.destination.error(err);\n }\n const innerSubscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n if (!innerSubscription || innerSubscription.closed) {\n this.clearThrottle();\n }\n else {\n this.add(this.throttled = innerSubscription);\n }\n }\n }\n clearThrottle() {\n const { value, hasValue, throttled } = this;\n if (throttled) {\n this.remove(throttled);\n this.throttled = undefined;\n throttled.unsubscribe();\n }\n if (hasValue) {\n this.va
|