1 line
7.3 KiB
JSON
1 line
7.3 KiB
JSON
|
{"ast":null,"code":"import { Subject } from '../Subject';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function windowWhen(closingSelector) {\n return function windowWhenOperatorFunction(source) {\n return source.lift(new WindowOperator(closingSelector));\n };\n}\nclass WindowOperator {\n constructor(closingSelector) {\n this.closingSelector = closingSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));\n }\n}\nclass WindowSubscriber extends OuterSubscriber {\n constructor(destination, closingSelector) {\n super(destination);\n this.destination = destination;\n this.closingSelector = closingSelector;\n this.openWindow();\n }\n notifyNext(_outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {\n this.openWindow(innerSub);\n }\n notifyError(error) {\n this._error(error);\n }\n notifyComplete(innerSub) {\n this.openWindow(innerSub);\n }\n _next(value) {\n this.window.next(value);\n }\n _error(err) {\n this.window.error(err);\n this.destination.error(err);\n this.unsubscribeClosingNotification();\n }\n _complete() {\n this.window.complete();\n this.destination.complete();\n this.unsubscribeClosingNotification();\n }\n unsubscribeClosingNotification() {\n if (this.closingNotification) {\n this.closingNotification.unsubscribe();\n }\n }\n openWindow(innerSub = null) {\n if (innerSub) {\n this.remove(innerSub);\n innerSub.unsubscribe();\n }\n const prevWindow = this.window;\n if (prevWindow) {\n prevWindow.complete();\n }\n const window = this.window = new Subject();\n this.destination.next(window);\n let closingNotifier;\n try {\n const {\n closingSelector\n } = this;\n closingNotifier = closingSelector();\n } catch (e) {\n this.destination.error(e);\n this.window.error(e);\n return;\n }\n this.add(this.closingNotification = subscribeToResult(this, closingNotifier));\n }\n}","map":{"version":3,"names":["Subject","OuterSubscriber","subscribeToResult","windowWhen","closingSelector","windowWhenOperatorFunction","source","lift","WindowOperator","constructor","call","subscriber","subscribe","WindowSubscriber","destination","openWindow","notifyNext","_outerValue","_innerValue","_outerIndex","_innerIndex","innerSub","notifyError","error","_error","notifyComplete","_next","value","window","next","err","unsubscribeClosingNotification","_complete","complete","closingNotification","unsubscribe","remove","prevWindow","closingNotifier","e","add"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/windowWhen.js"],"sourcesContent":["import { Subject } from '../Subject';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function windowWhen(closingSelector) {\n return function windowWhenOperatorFunction(source) {\n return source.lift(new WindowOperator(closingSelector));\n };\n}\nclass WindowOperator {\n constructor(closingSelector) {\n this.closingSelector = closingSelector;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));\n }\n}\nclass WindowSubscriber extends OuterSubscriber {\n constructor(destination, closingSelector) {\n super(destination);\n this.destination = destination;\n this.closingSelector = closingSelector;\n this.openWindow();\n }\n notifyNext(_outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {\n this.openWindow(innerSub);\n }\n notifyError(error) {\n this._error(error);\n }\n notifyComplete(innerSub) {\n this.openWindow(innerSub);\n }\n _next(value) {\n this.window.next(value);\n }\n _error(err) {\n this.window.error(err);\n this.destination.er
|