Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/9c9519f9db1eeea288324b24ff3c3d5ff8a1419ee0ae6cfebd2d4138a0a425e4.json

1 line
7.5 KiB
JSON
Raw Normal View History

2024-11-04 02:30:09 +00:00
{"ast":null,"code":"import { Subscriber } from '../Subscriber';\nimport { Subject } from '../Subject';\nexport function windowCount(windowSize, startWindowEvery = 0) {\n return function windowCountOperatorFunction(source) {\n return source.lift(new WindowCountOperator(windowSize, startWindowEvery));\n };\n}\nclass WindowCountOperator {\n constructor(windowSize, startWindowEvery) {\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));\n }\n}\nclass WindowCountSubscriber extends Subscriber {\n constructor(destination, windowSize, startWindowEvery) {\n super(destination);\n this.destination = destination;\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n this.windows = [new Subject()];\n this.count = 0;\n destination.next(this.windows[0]);\n }\n _next(value) {\n const startWindowEvery = this.startWindowEvery > 0 ? this.startWindowEvery : this.windowSize;\n const destination = this.destination;\n const windowSize = this.windowSize;\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len && !this.closed; i++) {\n windows[i].next(value);\n }\n const c = this.count - windowSize + 1;\n if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {\n windows.shift().complete();\n }\n if (++this.count % startWindowEvery === 0 && !this.closed) {\n const window = new Subject();\n windows.push(window);\n destination.next(window);\n }\n }\n _error(err) {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().error(err);\n }\n }\n this.destination.error(err);\n }\n _complete() {\n const windows = this.windows;\n if (windows) {\n while (windows.length > 0 && !this.closed) {\n windows.shift().complete();\n }\n }\n this.destination.complete();\n }\n _unsubscribe() {\n this.count = 0;\n this.windows = null;\n }\n}","map":{"version":3,"names":["Subscriber","Subject","windowCount","windowSize","startWindowEvery","windowCountOperatorFunction","source","lift","WindowCountOperator","constructor","call","subscriber","subscribe","WindowCountSubscriber","destination","windows","count","next","_next","value","len","length","i","closed","c","shift","complete","window","push","_error","err","error","_complete","_unsubscribe"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/windowCount.js"],"sourcesContent":["import { Subscriber } from '../Subscriber';\nimport { Subject } from '../Subject';\nexport function windowCount(windowSize, startWindowEvery = 0) {\n return function windowCountOperatorFunction(source) {\n return source.lift(new WindowCountOperator(windowSize, startWindowEvery));\n };\n}\nclass WindowCountOperator {\n constructor(windowSize, startWindowEvery) {\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n }\n call(subscriber, source) {\n return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));\n }\n}\nclass WindowCountSubscriber extends Subscriber {\n constructor(destination, windowSize, startWindowEvery) {\n super(destination);\n this.destination = destination;\n this.windowSize = windowSize;\n this.startWindowEvery = startWindowEvery;\n this.windows = [new Subject()];\n this.count = 0;\n destination.next(this.windows[0]);\n }\n _next(value) {\n const startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;\n const destination = this.destination;\n const windowSize = this.windowSize;\n const windows = this.windows;\n const len = windows.length;\n for (let i = 0; i < len && !this.close