1 line
7.0 KiB
JSON
1 line
7.0 KiB
JSON
{"ast":null,"code":"import { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\nexport function exhaustMap(project, resultSelector) {\n if (resultSelector) {\n return source => source.pipe(exhaustMap((a, i) => from(project(a, i)).pipe(map((b, ii) => resultSelector(a, b, i, ii)))));\n }\n\n return source => source.lift(new ExhaustMapOperator(project));\n}\n\nclass ExhaustMapOperator {\n constructor(project) {\n this.project = project;\n }\n\n call(subscriber, source) {\n return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));\n }\n\n}\n\nclass ExhaustMapSubscriber extends SimpleOuterSubscriber {\n constructor(destination, project) {\n super(destination);\n this.project = project;\n this.hasSubscription = false;\n this.hasCompleted = false;\n this.index = 0;\n }\n\n _next(value) {\n if (!this.hasSubscription) {\n this.tryNext(value);\n }\n }\n\n tryNext(value) {\n let result;\n const index = this.index++;\n\n try {\n result = this.project(value, index);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n\n this.hasSubscription = true;\n\n this._innerSub(result);\n }\n\n _innerSub(result) {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(result, innerSubscriber);\n\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n }\n\n _complete() {\n this.hasCompleted = true;\n\n if (!this.hasSubscription) {\n this.destination.complete();\n }\n\n this.unsubscribe();\n }\n\n notifyNext(innerValue) {\n this.destination.next(innerValue);\n }\n\n notifyError(err) {\n this.destination.error(err);\n }\n\n notifyComplete() {\n this.hasSubscription = false;\n\n if (this.hasCompleted) {\n this.destination.complete();\n }\n }\n\n}","map":{"version":3,"names":["map","from","SimpleOuterSubscriber","SimpleInnerSubscriber","innerSubscribe","exhaustMap","project","resultSelector","source","pipe","a","i","b","ii","lift","ExhaustMapOperator","constructor","call","subscriber","subscribe","ExhaustMapSubscriber","destination","hasSubscription","hasCompleted","index","_next","value","tryNext","result","err","error","_innerSub","innerSubscriber","add","innerSubscription","_complete","complete","unsubscribe","notifyNext","innerValue","next","notifyError","notifyComplete"],"sources":["D:/MobileDev/WRB/WrenchBoard2023a/node_modules/rxjs/_esm2015/internal/operators/exhaustMap.js"],"sourcesContent":["import { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\nexport function exhaustMap(project, resultSelector) {\n if (resultSelector) {\n return (source) => source.pipe(exhaustMap((a, i) => from(project(a, i)).pipe(map((b, ii) => resultSelector(a, b, i, ii)))));\n }\n return (source) => source.lift(new ExhaustMapOperator(project));\n}\nclass ExhaustMapOperator {\n constructor(project) {\n this.project = project;\n }\n call(subscriber, source) {\n return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));\n }\n}\nclass ExhaustMapSubscriber extends SimpleOuterSubscriber {\n constructor(destination, project) {\n super(destination);\n this.project = project;\n this.hasSubscription = false;\n this.hasCompleted = false;\n this.index = 0;\n }\n _next(value) {\n if (!this.hasSubscription) {\n this.tryNext(value);\n }\n }\n tryNext(value) {\n let result;\n const index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.hasSubscription = true;\n this._innerSub(result);\n }\n _innerSub(result) {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(result, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n }\n _complete() {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete();\n }\n this.unsubscribe();\n }\n notifyNext(innerValue) {\n this.destination.next(innerValue);\n }\n notifyError(err) {\n this.destination.error(err);\n }\n notifyComplete() {\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete();\n }\n }\n}\n"],"mappings":"AAAA,SAASA,GAAT,QAAo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