Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/411b60da9d8b15ea8d0c3551836798ee293af14fc26dfd09e1b69b3457fbc453.json

1 line
7.2 KiB
JSON
Raw Permalink Normal View History

2024-10-31 19:07:58 +00:00
{"ast":null,"code":"import { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function withLatestFrom(...args) {\n return source => {\n let project;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n const observables = args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\nclass WithLatestFromOperator {\n constructor(observables, project) {\n this.observables = observables;\n this.project = project;\n }\n call(subscriber, source) {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n }\n}\nclass WithLatestFromSubscriber extends OuterSubscriber {\n constructor(destination, observables, project) {\n super(destination);\n this.observables = observables;\n this.project = project;\n this.toRespond = [];\n const len = observables.length;\n this.values = new Array(len);\n for (let i = 0; i < len; i++) {\n this.toRespond.push(i);\n }\n for (let i = 0; i < len; i++) {\n let observable = observables[i];\n this.add(subscribeToResult(this, observable, undefined, i));\n }\n }\n notifyNext(_outerValue, innerValue, outerIndex) {\n this.values[outerIndex] = innerValue;\n const toRespond = this.toRespond;\n if (toRespond.length > 0) {\n const found = toRespond.indexOf(outerIndex);\n if (found !== -1) {\n toRespond.splice(found, 1);\n }\n }\n }\n notifyComplete() {}\n _next(value) {\n if (this.toRespond.length === 0) {\n const args = [value, ...this.values];\n if (this.project) {\n this._tryProject(args);\n } else {\n this.destination.next(args);\n }\n }\n }\n _tryProject(args) {\n let result;\n try {\n result = this.project.apply(this, args);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}","map":{"version":3,"names":["OuterSubscriber","subscribeToResult","withLatestFrom","args","source","project","length","pop","observables","lift","WithLatestFromOperator","constructor","call","subscriber","subscribe","WithLatestFromSubscriber","destination","toRespond","len","values","Array","i","push","observable","add","undefined","notifyNext","_outerValue","innerValue","outerIndex","found","indexOf","splice","notifyComplete","_next","value","_tryProject","next","result","apply","err","error"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js"],"sourcesContent":["import { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function withLatestFrom(...args) {\n return (source) => {\n let project;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n const observables = args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\nclass WithLatestFromOperator {\n constructor(observables, project) {\n this.observables = observables;\n this.project = project;\n }\n call(subscriber, source) {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n }\n}\nclass WithLatestFromSubscriber extends OuterSubscriber {\n constructor(destination, observables, project) {\n super(destination);\n this.observables = observables;\n this.project = project;\n this.toRespond = [];\n const len = observables.length;\n this.values = new Array(len);\n for (let i = 0; i < len; i++) {\n this.toRespond.push(i);\n }\n for (let i = 0; i < len; i++) {\n let observable = observables[i];\n this.add(subscribeToResult(this, observable, undefined, i));\n }\n }\n notifyNext(_outerValue, innerValue, outerIndex) {\n this.value