1 line
5.3 KiB
JSON
1 line
5.3 KiB
JSON
|
{"ast":null,"code":"import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function distinct(keySelector, flushes) {\n return source => source.lift(new DistinctOperator(keySelector, flushes));\n}\nclass DistinctOperator {\n constructor(keySelector, flushes) {\n this.keySelector = keySelector;\n this.flushes = flushes;\n }\n call(subscriber, source) {\n return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));\n }\n}\nexport class DistinctSubscriber extends SimpleOuterSubscriber {\n constructor(destination, keySelector, flushes) {\n super(destination);\n this.keySelector = keySelector;\n this.values = new Set();\n if (flushes) {\n this.add(innerSubscribe(flushes, new SimpleInnerSubscriber(this)));\n }\n }\n notifyNext() {\n this.values.clear();\n }\n notifyError(error) {\n this._error(error);\n }\n _next(value) {\n if (this.keySelector) {\n this._useKeySelector(value);\n } else {\n this._finalizeNext(value, value);\n }\n }\n _useKeySelector(value) {\n let key;\n const {\n destination\n } = this;\n try {\n key = this.keySelector(value);\n } catch (err) {\n destination.error(err);\n return;\n }\n this._finalizeNext(key, value);\n }\n _finalizeNext(key, value) {\n const {\n values\n } = this;\n if (!values.has(key)) {\n values.add(key);\n this.destination.next(value);\n }\n }\n}","map":{"version":3,"names":["SimpleOuterSubscriber","innerSubscribe","SimpleInnerSubscriber","distinct","keySelector","flushes","source","lift","DistinctOperator","constructor","call","subscriber","subscribe","DistinctSubscriber","destination","values","Set","add","notifyNext","clear","notifyError","error","_error","_next","value","_useKeySelector","_finalizeNext","key","err","has","next"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/distinct.js"],"sourcesContent":["import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function distinct(keySelector, flushes) {\n return (source) => source.lift(new DistinctOperator(keySelector, flushes));\n}\nclass DistinctOperator {\n constructor(keySelector, flushes) {\n this.keySelector = keySelector;\n this.flushes = flushes;\n }\n call(subscriber, source) {\n return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));\n }\n}\nexport class DistinctSubscriber extends SimpleOuterSubscriber {\n constructor(destination, keySelector, flushes) {\n super(destination);\n this.keySelector = keySelector;\n this.values = new Set();\n if (flushes) {\n this.add(innerSubscribe(flushes, new SimpleInnerSubscriber(this)));\n }\n }\n notifyNext() {\n this.values.clear();\n }\n notifyError(error) {\n this._error(error);\n }\n _next(value) {\n if (this.keySelector) {\n this._useKeySelector(value);\n }\n else {\n this._finalizeNext(value, value);\n }\n }\n _useKeySelector(value) {\n let key;\n const { destination } = this;\n try {\n key = this.keySelector(value);\n }\n catch (err) {\n destination.error(err);\n return;\n }\n this._finalizeNext(key, value);\n }\n _finalizeNext(key, value) {\n const { values } = this;\n if (!values.has(key)) {\n values.add(key);\n this.destination.next(value);\n }\n }\n}\n"],"mappings":"AAAA,SAASA,qBAAqB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,mBAAmB;AAChG,OAAO,SAASC,QAAQA,CAACC,WAAW,EAAEC,OAAO,EAAE;EAC3C,OAAQC,MAAM,IAAKA,MAAM,CAACC,IAAI,CAAC,IAAIC,gBAAgB,CAACJ,WAAW,EAAEC,OAAO,CAAC,CAAC;AAC9E;AACA,MAAMG,gBAAgB,CAAC;EACnBC,WAAWA,CAACL,WAAW,EAAEC,OAAO,EAAE;IAC9B,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EACAK,IAAIA,CAACC
|