X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Frxjs%2F_esm2015%2Finternal%2Foperators%2FwithLatestFrom.js;fp=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Frxjs%2F_esm2015%2Finternal%2Foperators%2FwithLatestFrom.js;h=fe47ae779479dd480f204f3c09f148a83364ca9f;hb=3aba54c891969552833dbc350b3139e944e17a97;hp=0000000000000000000000000000000000000000;hpb=1def8ecce8e6f3aa32e6978d0ba7846a99b8de34;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js new file mode 100644 index 00000000..fe47ae77 --- /dev/null +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js @@ -0,0 +1,73 @@ +import { OuterSubscriber } from '../OuterSubscriber'; +import { subscribeToResult } from '../util/subscribeToResult'; +export function withLatestFrom(...args) { + return (source) => { + let project; + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + const observables = args; + return source.lift(new WithLatestFromOperator(observables, project)); + }; +} +class WithLatestFromOperator { + constructor(observables, project) { + this.observables = observables; + this.project = project; + } + call(subscriber, source) { + return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project)); + } +} +class WithLatestFromSubscriber extends OuterSubscriber { + constructor(destination, observables, project) { + super(destination); + this.observables = observables; + this.project = project; + this.toRespond = []; + const len = observables.length; + this.values = new Array(len); + for (let i = 0; i < len; i++) { + this.toRespond.push(i); + } + for (let i = 0; i < len; i++) { + let observable = observables[i]; + this.add(subscribeToResult(this, observable, observable, i)); + } + } + notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { + this.values[outerIndex] = innerValue; + const toRespond = this.toRespond; + if (toRespond.length > 0) { + const found = toRespond.indexOf(outerIndex); + if (found !== -1) { + toRespond.splice(found, 1); + } + } + } + notifyComplete() { + } + _next(value) { + if (this.toRespond.length === 0) { + const args = [value, ...this.values]; + if (this.project) { + this._tryProject(args); + } + else { + this.destination.next(args); + } + } + } + _tryProject(args) { + let result; + try { + result = this.project.apply(this, args); + } + catch (err) { + this.destination.error(err); + return; + } + this.destination.next(result); + } +} +//# sourceMappingURL=withLatestFrom.js.map \ No newline at end of file