Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/f975fbf3246b6b675e0bbf0ce8d382c92477ad806a618156942cac0d26860648.json

1 line
6.9 KiB
JSON
Raw Permalink Normal View History

2024-10-31 19:07:58 +00:00
{"ast":null,"code":"import { Subscription } from '../Subscription';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function bufferWhen(closingSelector) {\n return function (source) {\n return source.lift(new BufferWhenOperator(closingSelector));\n };\n}\nclass BufferWhenOperator {\n constructor(closingSelector) {\n this.closingSelector = closingSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));\n }\n}\nclass BufferWhenSubscriber extends SimpleOuterSubscriber {\n constructor(destination, closingSelector) {\n super(destination);\n this.closingSelector = closingSelector;\n this.subscribing = false;\n this.openBuffer();\n }\n _next(value) {\n this.buffer.push(value);\n }\n _complete() {\n const buffer = this.buffer;\n if (buffer) {\n this.destination.next(buffer);\n }\n super._complete();\n }\n _unsubscribe() {\n this.buffer = undefined;\n this.subscribing = false;\n }\n notifyNext() {\n this.openBuffer();\n }\n notifyComplete() {\n if (this.subscribing) {\n this.complete();\n } else {\n this.openBuffer();\n }\n }\n openBuffer() {\n let {\n closingSubscription\n } = this;\n if (closingSubscription) {\n this.remove(closingSubscription);\n closingSubscription.unsubscribe();\n }\n const buffer = this.buffer;\n if (this.buffer) {\n this.destination.next(buffer);\n }\n this.buffer = [];\n let closingNotifier;\n try {\n const {\n closingSelector\n } = this;\n closingNotifier = closingSelector();\n } catch (err) {\n return this.error(err);\n }\n closingSubscription = new Subscription();\n this.closingSubscription = closingSubscription;\n this.add(closingSubscription);\n this.subscribing = true;\n closingSubscription.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(this)));\n this.subscribing = false;\n }\n}","map":{"version":3,"names":["Subscription","SimpleOuterSubscriber","innerSubscribe","SimpleInnerSubscriber","bufferWhen","closingSelector","source","lift","BufferWhenOperator","constructor","call","subscriber","subscribe","BufferWhenSubscriber","destination","subscribing","openBuffer","_next","value","buffer","push","_complete","next","_unsubscribe","undefined","notifyNext","notifyComplete","complete","closingSubscription","remove","unsubscribe","closingNotifier","err","error","add"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js"],"sourcesContent":["import { Subscription } from '../Subscription';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function bufferWhen(closingSelector) {\n return function (source) {\n return source.lift(new BufferWhenOperator(closingSelector));\n };\n}\nclass BufferWhenOperator {\n constructor(closingSelector) {\n this.closingSelector = closingSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));\n }\n}\nclass BufferWhenSubscriber extends SimpleOuterSubscriber {\n constructor(destination, closingSelector) {\n super(destination);\n this.closingSelector = closingSelector;\n this.subscribing = false;\n this.openBuffer();\n }\n _next(value) {\n this.buffer.push(value);\n }\n _complete() {\n const buffer = this.buffer;\n if (buffer) {\n this.destination.next(buffer);\n }\n super._complete();\n }\n _unsubscribe() {\n this.buffer = undefined;\n this.subscribing = false;\n }\n notifyNext() {\n this.openBuffer();\n }\n notifyComplete() {\n if (this.subscribing) {\n this.complete();\n }\n else {\n this.openBuffer();\n }\n }\n openBuffer() {\n