5ff648470bbd71d05b03b939fda0629ce620d90583613b1aeae98b87a4544f61.json 7.0 KB

1
  1. {"ast":null,"code":"import { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\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 OuterSubscriber {\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 = null;\n this.subscribing = false;\n }\n notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {\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(subscribeToResult(this, closingNotifier));\n this.subscribing = false;\n }\n}","map":{"version":3,"names":["Subscription","OuterSubscriber","subscribeToResult","bufferWhen","closingSelector","source","lift","BufferWhenOperator","constructor","call","subscriber","subscribe","BufferWhenSubscriber","destination","subscribing","openBuffer","_next","value","buffer","push","_complete","next","_unsubscribe","notifyNext","outerValue","innerValue","outerIndex","innerIndex","innerSub","notifyComplete","complete","closingSubscription","remove","unsubscribe","closingNotifier","err","error","add"],"sources":["C:/FatboarProject/angular-client/node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js"],"sourcesContent":["import { Subscription } from '../Subscription';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\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 OuterSubscriber {\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 = null;\n this.subscribing = false;\n }\n notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.openBuffer();\n }\n notifyComplete() {\n if (this.subscribing) {\n this.complete();\n }\n else {\n this.openBuffer();\n }\n }\n openBuffer() {\n let { closingSubscription } = 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 { closingSelector } = this;\n closingNotifier = closingSelector();\n }\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(subscribeToResult(this, closingNotifier));\n this.subscribing = false;\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,iBAAiB,QAAQ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