Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/13f4a7f053c16d2113dfed2325dee850c1df0aece1c95b5cdde03dd2f03d8958.json

1 line
9.7 KiB
JSON
Raw Permalink Normal View History

2024-11-04 02:30:09 +00:00
{"ast":null,"code":"import { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nexport class Observable {\n constructor(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n lift(operator) {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n subscribe(observerOrNext, error, complete) {\n const {\n operator\n } = this;\n const sink = toSubscriber(observerOrNext, error, complete);\n if (operator) {\n sink.add(operator.call(sink, this.source));\n } else {\n sink.add(this.source || config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));\n }\n if (config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n return sink;\n }\n _trySubscribe(sink) {\n try {\n return this._subscribe(sink);\n } catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError(sink)) {\n sink.error(err);\n } else {\n console.warn(err);\n }\n }\n }\n forEach(next, promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n let subscription;\n subscription = this.subscribe(value => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n });\n }\n _subscribe(subscriber) {\n const {\n source\n } = this;\n return source && source.subscribe(subscriber);\n }\n [Symbol_observable]() {\n return this;\n }\n pipe(...operations) {\n if (operations.length === 0) {\n return this;\n }\n return pipeFromArray(operations)(this);\n }\n toPromise(promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n let value;\n this.subscribe(x => value = x, err => reject(err), () => resolve(value));\n });\n }\n}\nObservable.create = subscribe => {\n return new Observable(subscribe);\n};\nfunction getPromiseCtor(promiseCtor) {\n if (!promiseCtor) {\n promiseCtor = config.Promise || Promise;\n }\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n return promiseCtor;\n}","map":{"version":3,"names":["canReportError","toSubscriber","observable","Symbol_observable","pipeFromArray","config","Observable","constructor","subscribe","_isScalar","_subscribe","lift","operator","source","observerOrNext","error","complete","sink","add","call","useDeprecatedSynchronousErrorHandling","syncErrorThrowable","_trySubscribe","syncErrorThrown","syncErrorValue","err","console","warn","forEach","next","promiseCtor","getPromiseCtor","resolve","reject","subscription","value","unsubscribe","subscriber","pipe","operations","length","toPromise","x","create","Promise","Error"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/Observable.js"],"sourcesContent":["import { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nexport class Observable {\n constructor(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n lift(operator)