feat: initial commit

This commit is contained in:
Carlos
2024-08-12 22:57:35 -04:00
commit 6f68ae8259
13140 changed files with 1104801 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import { Subject } from '../Subject';
import { Observable } from '../Observable';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
/**
* @class ConnectableObservable<T>
*/
export declare class ConnectableObservable<T> extends Observable<T> {
source: Observable<T>;
protected subjectFactory: () => Subject<T>;
protected _subject: Subject<T>;
protected _refCount: number;
protected _connection: Subscription;
/** @internal */
_isComplete: boolean;
constructor(source: Observable<T>, subjectFactory: () => Subject<T>);
/** @deprecated This is an internal implementation detail, do not use. */
_subscribe(subscriber: Subscriber<T>): Subscription;
protected getSubject(): Subject<T>;
connect(): Subscription;
refCount(): Observable<T>;
}
export declare const connectableObservableDescriptor: PropertyDescriptorMap;

View File

@ -0,0 +1,155 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Subject_1 = require("../Subject");
var Observable_1 = require("../Observable");
var Subscriber_1 = require("../Subscriber");
var Subscription_1 = require("../Subscription");
var refCount_1 = require("../operators/refCount");
var ConnectableObservable = (function (_super) {
__extends(ConnectableObservable, _super);
function ConnectableObservable(source, subjectFactory) {
var _this = _super.call(this) || this;
_this.source = source;
_this.subjectFactory = subjectFactory;
_this._refCount = 0;
_this._isComplete = false;
return _this;
}
ConnectableObservable.prototype._subscribe = function (subscriber) {
return this.getSubject().subscribe(subscriber);
};
ConnectableObservable.prototype.getSubject = function () {
var subject = this._subject;
if (!subject || subject.isStopped) {
this._subject = this.subjectFactory();
}
return this._subject;
};
ConnectableObservable.prototype.connect = function () {
var connection = this._connection;
if (!connection) {
this._isComplete = false;
connection = this._connection = new Subscription_1.Subscription();
connection.add(this.source
.subscribe(new ConnectableSubscriber(this.getSubject(), this)));
if (connection.closed) {
this._connection = null;
connection = Subscription_1.Subscription.EMPTY;
}
}
return connection;
};
ConnectableObservable.prototype.refCount = function () {
return refCount_1.refCount()(this);
};
return ConnectableObservable;
}(Observable_1.Observable));
exports.ConnectableObservable = ConnectableObservable;
exports.connectableObservableDescriptor = (function () {
var connectableProto = ConnectableObservable.prototype;
return {
operator: { value: null },
_refCount: { value: 0, writable: true },
_subject: { value: null, writable: true },
_connection: { value: null, writable: true },
_subscribe: { value: connectableProto._subscribe },
_isComplete: { value: connectableProto._isComplete, writable: true },
getSubject: { value: connectableProto.getSubject },
connect: { value: connectableProto.connect },
refCount: { value: connectableProto.refCount }
};
})();
var ConnectableSubscriber = (function (_super) {
__extends(ConnectableSubscriber, _super);
function ConnectableSubscriber(destination, connectable) {
var _this = _super.call(this, destination) || this;
_this.connectable = connectable;
return _this;
}
ConnectableSubscriber.prototype._error = function (err) {
this._unsubscribe();
_super.prototype._error.call(this, err);
};
ConnectableSubscriber.prototype._complete = function () {
this.connectable._isComplete = true;
this._unsubscribe();
_super.prototype._complete.call(this);
};
ConnectableSubscriber.prototype._unsubscribe = function () {
var connectable = this.connectable;
if (connectable) {
this.connectable = null;
var connection = connectable._connection;
connectable._refCount = 0;
connectable._subject = null;
connectable._connection = null;
if (connection) {
connection.unsubscribe();
}
}
};
return ConnectableSubscriber;
}(Subject_1.SubjectSubscriber));
var RefCountOperator = (function () {
function RefCountOperator(connectable) {
this.connectable = connectable;
}
RefCountOperator.prototype.call = function (subscriber, source) {
var connectable = this.connectable;
connectable._refCount++;
var refCounter = new RefCountSubscriber(subscriber, connectable);
var subscription = source.subscribe(refCounter);
if (!refCounter.closed) {
refCounter.connection = connectable.connect();
}
return subscription;
};
return RefCountOperator;
}());
var RefCountSubscriber = (function (_super) {
__extends(RefCountSubscriber, _super);
function RefCountSubscriber(destination, connectable) {
var _this = _super.call(this, destination) || this;
_this.connectable = connectable;
return _this;
}
RefCountSubscriber.prototype._unsubscribe = function () {
var connectable = this.connectable;
if (!connectable) {
this.connection = null;
return;
}
this.connectable = null;
var refCount = connectable._refCount;
if (refCount <= 0) {
this.connection = null;
return;
}
connectable._refCount = refCount - 1;
if (refCount > 1) {
this.connection = null;
return;
}
var connection = this.connection;
var sharedConnection = connectable._connection;
this.connection = null;
if (sharedConnection && (!connection || sharedConnection === connection)) {
sharedConnection.unsubscribe();
}
};
return RefCountSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=ConnectableObservable.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ConnectableObservable.js","sources":["../../src/internal/observable/ConnectableObservable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAwD;AAExD,4CAA2C;AAC3C,4CAA2C;AAC3C,gDAA+C;AAE/C,kDAAwE;AAKxE;IAA8C,yCAAa;IAQzD,+BAAmB,MAAqB,EAClB,cAAgC;QADtD,YAEE,iBAAO,SACR;QAHkB,YAAM,GAAN,MAAM,CAAe;QAClB,oBAAc,GAAd,cAAc,CAAkB;QAN5C,eAAS,GAAW,CAAC,CAAC;QAGhC,iBAAW,GAAG,KAAK,CAAC;;IAKpB,CAAC;IAGD,0CAAU,GAAV,UAAW,UAAyB;QAClC,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAES,0CAAU,GAApB;QACE,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,SAAS,EAAE;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;SACvC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,uCAAO,GAAP;QACE,IAA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D7C"}

View File

@ -0,0 +1,25 @@
import { SchedulerLike, SchedulerAction } from '../types';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
import { Observable } from '../Observable';
export interface DispatchArg<T> {
source: Observable<T>;
subscriber: Subscriber<T>;
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @extends {Ignored}
* @hide true
*/
export declare class SubscribeOnObservable<T> extends Observable<T> {
source: Observable<T>;
private delayTime;
private scheduler;
/** @nocollapse */
static create<T>(source: Observable<T>, delay?: number, scheduler?: SchedulerLike): Observable<T>;
/** @nocollapse */
static dispatch<T>(this: SchedulerAction<T>, arg: DispatchArg<T>): Subscription;
constructor(source: Observable<T>, delayTime?: number, scheduler?: SchedulerLike);
/** @deprecated This is an internal implementation detail, do not use. */
_subscribe(subscriber: Subscriber<T>): Subscription;
}

View File

@ -0,0 +1,56 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var asap_1 = require("../scheduler/asap");
var isNumeric_1 = require("../util/isNumeric");
var SubscribeOnObservable = (function (_super) {
__extends(SubscribeOnObservable, _super);
function SubscribeOnObservable(source, delayTime, scheduler) {
if (delayTime === void 0) { delayTime = 0; }
if (scheduler === void 0) { scheduler = asap_1.asap; }
var _this = _super.call(this) || this;
_this.source = source;
_this.delayTime = delayTime;
_this.scheduler = scheduler;
if (!isNumeric_1.isNumeric(delayTime) || delayTime < 0) {
_this.delayTime = 0;
}
if (!scheduler || typeof scheduler.schedule !== 'function') {
_this.scheduler = asap_1.asap;
}
return _this;
}
SubscribeOnObservable.create = function (source, delay, scheduler) {
if (delay === void 0) { delay = 0; }
if (scheduler === void 0) { scheduler = asap_1.asap; }
return new SubscribeOnObservable(source, delay, scheduler);
};
SubscribeOnObservable.dispatch = function (arg) {
var source = arg.source, subscriber = arg.subscriber;
return this.add(source.subscribe(subscriber));
};
SubscribeOnObservable.prototype._subscribe = function (subscriber) {
var delay = this.delayTime;
var source = this.source;
var scheduler = this.scheduler;
return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
source: source, subscriber: subscriber
});
};
return SubscribeOnObservable;
}(Observable_1.Observable));
exports.SubscribeOnObservable = SubscribeOnObservable;
//# sourceMappingURL=SubscribeOnObservable.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"SubscribeOnObservable.js","sources":["../../src/internal/observable/SubscribeOnObservable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,4CAA2C;AAC3C,0CAAyC;AACzC,+CAA8C;AAY9C;IAA8C,yCAAa;IAYzD,+BAAmB,MAAqB,EACpB,SAAqB,EACrB,SAA+B;QAD/B,0BAAA,EAAA,aAAqB;QACrB,0BAAA,EAAA,YAA2B,WAAI;QAFnD,YAGE,iBAAO,SAOR;QAVkB,YAAM,GAAN,MAAM,CAAe;QACpB,eAAS,GAAT,SAAS,CAAY;QACrB,eAAS,GAAT,SAAS,CAAsB;QAEjD,IAAI,CAAC,qBAAS,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE;YAC1C,KAAI,CAAC,SAAS,GAAG,CAAC,CAAC;SACpB;QACD,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,UAAU,EAAE;YAC1D,KAAI,CAAC,SAAS,GAAG,WAAI,CAAC;SACvB;;IACH,CAAC;IApBM,4BAAM,GAAb,UAAiB,MAAqB,EAAE,KAAiB,EAAE,SAA+B;QAAlD,sBAAA,EAAA,SAAiB;QAAE,0BAAA,EAAA,YAA2B,WAAI;QACxF,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;IAGM,8BAAQ,GAAf,UAA6C,GAAmB;QACtD,IAAA,mBAAM,EAAE,2BAAU,CAAS;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAChD,CAAC;IAeD,0CAAU,GAAV,UAAW,UAAyB;QAClC,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAEjC,OAAO,SAAS,CAAC,QAAQ,CAAmB,qBAAqB,CAAC,QAAQ,EAAE,KAAK,EAAE;YACjF,MAAM,QAAA,EAAE,UAAU,YAAA;SACnB,CAAC,CAAC;IACL,CAAC;IACH,4BAAC;AAAD,CAAC,AAlCD,CAA8C,uBAAU,GAkCvD;AAlCY,sDAAqB"}

View File

@ -0,0 +1,37 @@
import { SchedulerLike } from '../types';
import { Observable } from '../Observable';
/** @deprecated resultSelector is no longer supported, use a mapping function. */
export declare function bindCallback(callbackFunc: Function, resultSelector: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;
export declare function bindCallback<R1, R2, R3, R4>(callbackFunc: (callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): () => Observable<any[]>;
export declare function bindCallback<R1, R2, R3>(callbackFunc: (callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2, R3]>;
export declare function bindCallback<R1, R2>(callbackFunc: (callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2]>;
export declare function bindCallback<R1>(callbackFunc: (callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): () => Observable<R1>;
export declare function bindCallback(callbackFunc: (callback: () => any) => any, scheduler?: SchedulerLike): () => Observable<void>;
export declare function bindCallback<A1, R1, R2, R3, R4>(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<any[]>;
export declare function bindCallback<A1, R1, R2, R3>(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2, R3]>;
export declare function bindCallback<A1, R1, R2>(callbackFunc: (arg1: A1, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2]>;
export declare function bindCallback<A1, R1>(callbackFunc: (arg1: A1, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<R1>;
export declare function bindCallback<A1>(callbackFunc: (arg1: A1, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<void>;
export declare function bindCallback<A1, A2, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<any[]>;
export declare function bindCallback<A1, A2, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2, R3]>;
export declare function bindCallback<A1, A2, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2]>;
export declare function bindCallback<A1, A2, R1>(callbackFunc: (arg1: A1, arg2: A2, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<R1>;
export declare function bindCallback<A1, A2>(callbackFunc: (arg1: A1, arg2: A2, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<void>;
export declare function bindCallback<A1, A2, A3, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<any[]>;
export declare function bindCallback<A1, A2, A3, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2, R3]>;
export declare function bindCallback<A1, A2, A3, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2]>;
export declare function bindCallback<A1, A2, A3, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<R1>;
export declare function bindCallback<A1, A2, A3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<void>;
export declare function bindCallback<A1, A2, A3, A4, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<any[]>;
export declare function bindCallback<A1, A2, A3, A4, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2, R3]>;
export declare function bindCallback<A1, A2, A3, A4, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2]>;
export declare function bindCallback<A1, A2, A3, A4, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<R1>;
export declare function bindCallback<A1, A2, A3, A4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<void>;
export declare function bindCallback<A1, A2, A3, A4, A5, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<any[]>;
export declare function bindCallback<A1, A2, A3, A4, A5, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2, R3]>;
export declare function bindCallback<A1, A2, A3, A4, A5, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2]>;
export declare function bindCallback<A1, A2, A3, A4, A5, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<R1>;
export declare function bindCallback<A1, A2, A3, A4, A5>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: () => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<void>;
export declare function bindCallback<A, R>(callbackFunc: (...args: Array<A | ((result: R) => any)>) => any, scheduler?: SchedulerLike): (...args: A[]) => Observable<R>;
export declare function bindCallback<A, R>(callbackFunc: (...args: Array<A | ((...results: R[]) => any)>) => any, scheduler?: SchedulerLike): (...args: A[]) => Observable<R[]>;
export declare function bindCallback(callbackFunc: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;

107
node_modules/rxjs/internal/observable/bindCallback.js generated vendored Normal file
View File

@ -0,0 +1,107 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var AsyncSubject_1 = require("../AsyncSubject");
var map_1 = require("../operators/map");
var canReportError_1 = require("../util/canReportError");
var isArray_1 = require("../util/isArray");
var isScheduler_1 = require("../util/isScheduler");
function bindCallback(callbackFunc, resultSelector, scheduler) {
if (resultSelector) {
if (isScheduler_1.isScheduler(resultSelector)) {
scheduler = resultSelector;
}
else {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(map_1.map(function (args) { return isArray_1.isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
};
}
}
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var context = this;
var subject;
var params = {
context: context,
subject: subject,
callbackFunc: callbackFunc,
scheduler: scheduler,
};
return new Observable_1.Observable(function (subscriber) {
if (!scheduler) {
if (!subject) {
subject = new AsyncSubject_1.AsyncSubject();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
subject.complete();
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
if (canReportError_1.canReportError(subject)) {
subject.error(err);
}
else {
console.warn(err);
}
}
}
return subject.subscribe(subscriber);
}
else {
var state = {
args: args, subscriber: subscriber, params: params,
};
return scheduler.schedule(dispatch, 0, state);
}
});
};
}
exports.bindCallback = bindCallback;
function dispatch(state) {
var _this = this;
var self = this;
var args = state.args, subscriber = state.subscriber, params = state.params;
var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
var subject = params.subject;
if (!subject) {
subject = params.subject = new AsyncSubject_1.AsyncSubject();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
_this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
subject.error(err);
}
}
this.add(subject.subscribe(subscriber));
}
function dispatchNext(state) {
var value = state.value, subject = state.subject;
subject.next(value);
subject.complete();
}
function dispatchError(state) {
var err = state.err, subject = state.subject;
subject.error(err);
}
//# sourceMappingURL=bindCallback.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"bindCallback.js","sources":["../../src/internal/observable/bindCallback.ts"],"names":[],"mappings":";;AACA,4CAA2C;AAC3C,gDAA+C;AAE/C,wCAAuC;AACvC,yDAAwD;AACxD,2CAA0C;AAC1C,mDAAkD;AA4KlD,SAAgB,YAAY,CAC1B,YAAsB,EACtB,cAAuC,EACvC,SAAyB;IAEzB,IAAI,cAAc,EAAE;QAClB,IAAI,yBAAW,CAAC,cAAc,CAAC,EAAE;YAC/B,SAAS,GAAG,cAAc,CAAC;SAC5B;aAAM;YAEL,OAAO;gBAAC,cAAc;qBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;oBAAd,yBAAc;;gBAAK,OAAA,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,eAAI,IAAI,EAAE,IAAI,CAC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;AAOD,SAAS,YAAY,CAAyC,KAAmB;IACvE,IAAA,mBAAK,EAAE,uBAAO,CAAW;IACjC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,OAAO,CAAC,QAAQ,EAAE,CAAC;AACrB,CAAC;AAOD,SAAS,aAAa,CAA0C,KAAoB;IAC1E,IAAA,eAAG,EAAE,uBAAO,CAAW;IAC/B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC"}

View File

@ -0,0 +1,35 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
/** @deprecated resultSelector is deprecated, pipe to map instead */
export declare function bindNodeCallback(callbackFunc: Function, resultSelector: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;
export declare function bindNodeCallback<R1, R2, R3, R4>(callbackFunc: (callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;
export declare function bindNodeCallback<R1, R2, R3>(callbackFunc: (callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2, R3]>;
export declare function bindNodeCallback<R1, R2>(callbackFunc: (callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): () => Observable<[R1, R2]>;
export declare function bindNodeCallback<R1>(callbackFunc: (callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): () => Observable<R1>;
export declare function bindNodeCallback(callbackFunc: (callback: (err: any) => any) => any, scheduler?: SchedulerLike): () => Observable<void>;
export declare function bindNodeCallback<A1, R1, R2, R3, R4>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;
export declare function bindNodeCallback<A1, R1, R2, R3>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2, R3]>;
export declare function bindNodeCallback<A1, R1, R2>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<[R1, R2]>;
export declare function bindNodeCallback<A1, R1>(callbackFunc: (arg1: A1, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<R1>;
export declare function bindNodeCallback<A1>(callbackFunc: (arg1: A1, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1) => Observable<void>;
export declare function bindNodeCallback<A1, A2, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;
export declare function bindNodeCallback<A1, A2, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2, R3]>;
export declare function bindNodeCallback<A1, A2, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<[R1, R2]>;
export declare function bindNodeCallback<A1, A2, R1>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<R1>;
export declare function bindNodeCallback<A1, A2>(callbackFunc: (arg1: A1, arg2: A2, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2) => Observable<void>;
export declare function bindNodeCallback<A1, A2, A3, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;
export declare function bindNodeCallback<A1, A2, A3, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2, R3]>;
export declare function bindNodeCallback<A1, A2, A3, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<[R1, R2]>;
export declare function bindNodeCallback<A1, A2, A3, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<R1>;
export declare function bindNodeCallback<A1, A2, A3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3) => Observable<void>;
export declare function bindNodeCallback<A1, A2, A3, A4, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;
export declare function bindNodeCallback<A1, A2, A3, A4, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2, R3]>;
export declare function bindNodeCallback<A1, A2, A3, A4, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<[R1, R2]>;
export declare function bindNodeCallback<A1, A2, A3, A4, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<R1>;
export declare function bindNodeCallback<A1, A2, A3, A4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Observable<void>;
export declare function bindNodeCallback<A1, A2, A3, A4, A5, R1, R2, R3, R4>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2, res3: R3, res4: R4, ...args: any[]) => any) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;
export declare function bindNodeCallback<A1, A2, A3, A4, A5, R1, R2, R3>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2, res3: R3) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2, R3]>;
export declare function bindNodeCallback<A1, A2, A3, A4, A5, R1, R2>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1, res2: R2) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<[R1, R2]>;
export declare function bindNodeCallback<A1, A2, A3, A4, A5, R1>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, res1: R1) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<R1>;
export declare function bindNodeCallback<A1, A2, A3, A4, A5>(callbackFunc: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any) => any) => any, scheduler?: SchedulerLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Observable<void>;
export declare function bindNodeCallback(callbackFunc: Function, scheduler?: SchedulerLike): (...args: any[]) => Observable<any[]>;

View File

@ -0,0 +1,115 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var AsyncSubject_1 = require("../AsyncSubject");
var map_1 = require("../operators/map");
var canReportError_1 = require("../util/canReportError");
var isScheduler_1 = require("../util/isScheduler");
var isArray_1 = require("../util/isArray");
function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
if (resultSelector) {
if (isScheduler_1.isScheduler(resultSelector)) {
scheduler = resultSelector;
}
else {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(map_1.map(function (args) { return isArray_1.isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
};
}
}
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var params = {
subject: undefined,
args: args,
callbackFunc: callbackFunc,
scheduler: scheduler,
context: this,
};
return new Observable_1.Observable(function (subscriber) {
var context = params.context;
var subject = params.subject;
if (!scheduler) {
if (!subject) {
subject = params.subject = new AsyncSubject_1.AsyncSubject();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
var err = innerArgs.shift();
if (err) {
subject.error(err);
return;
}
subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
subject.complete();
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
if (canReportError_1.canReportError(subject)) {
subject.error(err);
}
else {
console.warn(err);
}
}
}
return subject.subscribe(subscriber);
}
else {
return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context });
}
});
};
}
exports.bindNodeCallback = bindNodeCallback;
function dispatch(state) {
var _this = this;
var params = state.params, subscriber = state.subscriber, context = state.context;
var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;
var subject = params.subject;
if (!subject) {
subject = params.subject = new AsyncSubject_1.AsyncSubject();
var handler = function () {
var innerArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
innerArgs[_i] = arguments[_i];
}
var err = innerArgs.shift();
if (err) {
_this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
}
else {
var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
_this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
}
};
try {
callbackFunc.apply(context, args.concat([handler]));
}
catch (err) {
this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
}
}
this.add(subject.subscribe(subscriber));
}
function dispatchNext(arg) {
var value = arg.value, subject = arg.subject;
subject.next(value);
subject.complete();
}
function dispatchError(arg) {
var err = arg.err, subject = arg.subject;
subject.error(err);
}
//# sourceMappingURL=bindNodeCallback.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"bindNodeCallback.js","sources":["../../src/internal/observable/bindNodeCallback.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAC3C,gDAA+C;AAG/C,wCAAuC;AACvC,yDAAwD;AACxD,mDAAkD;AAClD,2CAA0C;AAoJ1C,SAAgB,gBAAgB,CAC9B,YAAsB,EACtB,cAAsC,EACtC,SAAyB;IAGzB,IAAI,cAAc,EAAE;QAClB,IAAI,yBAAW,CAAC,cAAc,CAAC,EAAE;YAC/B,SAAS,GAAG,cAAc,CAAC;SAC5B;aAAM;YAEL,OAAO;gBAAC,cAAc;qBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;oBAAd,yBAAc;;gBAAK,OAAA,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAC,eAAI,IAAI,EAAE,IAAI,CAChF,SAAG,CAAC,UAAA,IAAI,IAAI,OAAA,iBAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,eAAI,IAAI,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,EAA9D,CAA8D,CAAC,CAC5E;YAF0B,CA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AAI,SAAE,OAAO,GAAE,CAAC;SACjD;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAsB,aAAa,EAAE,CAAC,EAAE,EAAE,GAAG,KAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC,CAAC;SACvF;KACF;IAED,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;AAC1C,CAAC;AAOD,SAAS,YAAY,CAAI,GAAuB;IACtC,IAAA,iBAAK,EAAE,qBAAO,CAAS;IAC/B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,OAAO,CAAC,QAAQ,EAAE,CAAC;AACrB,CAAC;AAOD,SAAS,aAAa,CAAI,GAAwB;IACxC,IAAA,aAAG,EAAE,qBAAO,CAAS;IAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC"}

View File

@ -0,0 +1,99 @@
import { Observable } from '../Observable';
import { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';
import { Subscriber } from '../Subscriber';
import { OuterSubscriber } from '../OuterSubscriber';
import { Operator } from '../Operator';
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, R>(sources: [O1], resultSelector: (v1: ObservedValueOf<O1>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, R>(sources: [O1, O2], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, R>(sources: [O1, O2, O3], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4, O5], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4, O5, O6], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>, v6: ObservedValueOf<O6>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O extends ObservableInput<any>, R>(sources: O[], resultSelector: (...args: ObservedValueOf<O>[]) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, R>(v1: O1, resultSelector: (v1: ObservedValueOf<O1>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, R>(v1: O1, v2: O2, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>, v6: ObservedValueOf<O6>) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O1 extends ObservableInput<any>>(sources: [O1], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>]>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(sources: [O1, O2], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(sources: [O1, O2, O3], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(sources: [O1, O2, O3, O4], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5, O6], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O extends ObservableInput<any>>(sources: O[], scheduler: SchedulerLike): Observable<ObservedValueOf<O>[]>;
export declare function combineLatest<O1 extends ObservableInput<any>>(sources: [O1]): Observable<[ObservedValueOf<O1>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(sources: [O1, O2]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(sources: [O1, O2, O3]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(sources: [O1, O2, O3, O4]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5, O6]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;
export declare function combineLatest<O extends ObservableInput<any>>(sources: O[]): Observable<ObservedValueOf<O>[]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O1 extends ObservableInput<any>>(v1: O1, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O extends ObservableInput<any>>(...observables: O[]): Observable<any[]>;
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
export declare function combineLatest<O extends ObservableInput<any>, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function combineLatest<O extends ObservableInput<any>, R>(array: O[], resultSelector: (...values: ObservedValueOf<O>[]) => R, scheduler?: SchedulerLike): Observable<R>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O extends ObservableInput<any>>(...observables: Array<O | SchedulerLike>): Observable<any[]>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<O extends ObservableInput<any>, R>(...observables: Array<O | ((...values: ObservedValueOf<O>[]) => R) | SchedulerLike>): Observable<R>;
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
export declare function combineLatest<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R) | SchedulerLike>): Observable<R>;
export declare class CombineLatestOperator<T, R> implements Operator<T, R> {
private resultSelector?;
constructor(resultSelector?: (...values: Array<any>) => R);
call(subscriber: Subscriber<R>, source: any): any;
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
export declare class CombineLatestSubscriber<T, R> extends OuterSubscriber<T, R> {
private resultSelector?;
private active;
private values;
private observables;
private toRespond?;
constructor(destination: Subscriber<R>, resultSelector?: (...values: Array<any>) => R);
protected _next(observable: any): void;
protected _complete(): void;
notifyComplete(unused: Subscriber<R>): void;
notifyNext(_outerValue: T, innerValue: R, outerIndex: number): void;
private _tryResultSelector;
}

115
node_modules/rxjs/internal/observable/combineLatest.js generated vendored Normal file
View File

@ -0,0 +1,115 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var isScheduler_1 = require("../util/isScheduler");
var isArray_1 = require("../util/isArray");
var OuterSubscriber_1 = require("../OuterSubscriber");
var subscribeToResult_1 = require("../util/subscribeToResult");
var fromArray_1 = require("./fromArray");
var NONE = {};
function combineLatest() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
var resultSelector = undefined;
var scheduler = undefined;
if (isScheduler_1.isScheduler(observables[observables.length - 1])) {
scheduler = observables.pop();
}
if (typeof observables[observables.length - 1] === 'function') {
resultSelector = observables.pop();
}
if (observables.length === 1 && isArray_1.isArray(observables[0])) {
observables = observables[0];
}
return fromArray_1.fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
}
exports.combineLatest = combineLatest;
var CombineLatestOperator = (function () {
function CombineLatestOperator(resultSelector) {
this.resultSelector = resultSelector;
}
CombineLatestOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
};
return CombineLatestOperator;
}());
exports.CombineLatestOperator = CombineLatestOperator;
var CombineLatestSubscriber = (function (_super) {
__extends(CombineLatestSubscriber, _super);
function CombineLatestSubscriber(destination, resultSelector) {
var _this = _super.call(this, destination) || this;
_this.resultSelector = resultSelector;
_this.active = 0;
_this.values = [];
_this.observables = [];
return _this;
}
CombineLatestSubscriber.prototype._next = function (observable) {
this.values.push(NONE);
this.observables.push(observable);
};
CombineLatestSubscriber.prototype._complete = function () {
var observables = this.observables;
var len = observables.length;
if (len === 0) {
this.destination.complete();
}
else {
this.active = len;
this.toRespond = len;
for (var i = 0; i < len; i++) {
var observable = observables[i];
this.add(subscribeToResult_1.subscribeToResult(this, observable, undefined, i));
}
}
};
CombineLatestSubscriber.prototype.notifyComplete = function (unused) {
if ((this.active -= 1) === 0) {
this.destination.complete();
}
};
CombineLatestSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {
var values = this.values;
var oldVal = values[outerIndex];
var toRespond = !this.toRespond
? 0
: oldVal === NONE ? --this.toRespond : this.toRespond;
values[outerIndex] = innerValue;
if (toRespond === 0) {
if (this.resultSelector) {
this._tryResultSelector(values);
}
else {
this.destination.next(values.slice());
}
}
};
CombineLatestSubscriber.prototype._tryResultSelector = function (values) {
var result;
try {
result = this.resultSelector.apply(this, values);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.next(result);
};
return CombineLatestSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.CombineLatestSubscriber = CombineLatestSubscriber;
//# sourceMappingURL=combineLatest.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"combineLatest.js","sources":["../../src/internal/observable/combineLatest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,mDAAmD;AACnD,2CAA2C;AAE3C,sDAAqD;AAGrD,+DAA8D;AAC9D,yCAAwC;AAExC,IAAM,IAAI,GAAG,EAAE,CAAC;AAsNhB,SAAgB,aAAa;IAC3B,qBAAgF;SAAhF,UAAgF,EAAhF,qBAAgF,EAAhF,IAAgF;QAAhF,gCAAgF;;IAEhF,IAAI,cAAc,GAAgD,SAAS,CAAC;IAC5E,IAAI,SAAS,GAA4B,SAAS,CAAC;IAEnD,IAA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,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;aACjC;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,IAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;aACxC;SACF;IACH,CAAC;IAEO,oDAAkB,GAA1B,UAA2B,MAAa;QACtC,IAAI,MAAW,CAAC;QAChB,IAAI;YACF,MAAM,GAAG,IAAI,CAAC,cAAe,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SACnD;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAM,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO;SACR;QACD,IAAI,CAAC,WAAW,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IACH,8BAAC;AAAD,CAAC,AAhED,CAAmD,iCAAe,GAgEjE;AAhEY,0DAAuB"}

26
node_modules/rxjs/internal/observable/concat.d.ts generated vendored Normal file
View File

@ -0,0 +1,26 @@
import { Observable } from '../Observable';
import { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<O1 extends ObservableInput<any>>(v1: O1, scheduler: SchedulerLike): Observable<ObservedValueOf<O1>>;
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2>>;
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3>>;
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4>>;
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5>>;
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5> | ObservedValueOf<O6>>;
export declare function concat<O1 extends ObservableInput<any>>(v1: O1): Observable<ObservedValueOf<O1>>;
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2): Observable<ObservedValueOf<O1> | ObservedValueOf<O2>>;
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3>>;
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4>>;
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5>>;
export declare function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5> | ObservedValueOf<O6>>;
export declare function concat<O extends ObservableInput<any>>(...observables: O[]): Observable<ObservedValueOf<O>>;
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<O extends ObservableInput<any>>(...observables: (O | SchedulerLike)[]): Observable<ObservedValueOf<O>>;
export declare function concat<R>(...observables: ObservableInput<any>[]): Observable<R>;
/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */
export declare function concat<R>(...observables: (ObservableInput<any> | SchedulerLike)[]): Observable<R>;

13
node_modules/rxjs/internal/observable/concat.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var of_1 = require("./of");
var concatAll_1 = require("../operators/concatAll");
function concat() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
return concatAll_1.concatAll()(of_1.of.apply(void 0, observables));
}
exports.concat = concat;
//# sourceMappingURL=concat.js.map

1
node_modules/rxjs/internal/observable/concat.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"concat.js","sources":["../../src/internal/observable/concat.ts"],"names":[],"mappings":";;AAGA,2BAA0B;AAE1B,oDAAmD;AA2InD,SAAgB,MAAM;IAAoC,qBAAwC;SAAxC,UAAwC,EAAxC,qBAAwC,EAAxC,IAAwC;QAAxC,gCAAwC;;IAChG,OAAO,qBAAS,EAAK,CAAC,OAAE,eAAI,WAAW,EAAE,CAAC;AAC5C,CAAC;AAFD,wBAEC"}

52
node_modules/rxjs/internal/observable/defer.d.ts generated vendored Normal file
View File

@ -0,0 +1,52 @@
import { Observable } from '../Observable';
import { ObservedValueOf, ObservableInput } from '../types';
/**
* Creates an Observable that, on subscribe, calls an Observable factory to
* make an Observable for each new Observer.
*
* <span class="informal">Creates the Observable lazily, that is, only when it
* is subscribed.
* </span>
*
* ![](defer.png)
*
* `defer` allows you to create the Observable only when the Observer
* subscribes, and create a fresh Observable for each Observer. It waits until
* an Observer subscribes to it, and then it generates an Observable,
* typically with an Observable factory function. It does this afresh for each
* subscriber, so although each subscriber may think it is subscribing to the
* same Observable, in fact each subscriber gets its own individual
* Observable.
*
* ## Example
* ### Subscribe to either an Observable of clicks or an Observable of interval, at random
* ```ts
* import { defer, fromEvent, interval } from 'rxjs';
*
* const clicksOrInterval = defer(function () {
* return Math.random() > 0.5
* ? fromEvent(document, 'click')
* : interval(1000);
* });
* clicksOrInterval.subscribe(x => console.log(x));
*
* // Results in the following behavior:
* // If the result of Math.random() is greater than 0.5 it will listen
* // for clicks anywhere on the "document"; when document is clicked it
* // will log a MouseEvent object to the console. If the result is less
* // than 0.5 it will emit ascending numbers, one every second(1000ms).
* ```
*
* @see {@link Observable}
*
* @param {function(): SubscribableOrPromise} observableFactory The Observable
* factory function to invoke for each Observer that subscribes to the output
* Observable. May also return a Promise, which will be converted on the fly
* to an Observable.
* @return {Observable} An Observable whose Observers' subscriptions trigger
* an invocation of the given Observable factory function.
* @static true
* @name defer
* @owner Observable
*/
export declare function defer<R extends ObservableInput<any> | void>(observableFactory: () => R): Observable<ObservedValueOf<R>>;

21
node_modules/rxjs/internal/observable/defer.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var from_1 = require("./from");
var empty_1 = require("./empty");
function defer(observableFactory) {
return new Observable_1.Observable(function (subscriber) {
var input;
try {
input = observableFactory();
}
catch (err) {
subscriber.error(err);
return undefined;
}
var source = input ? from_1.from(input) : empty_1.empty();
return source.subscribe(subscriber);
});
}
exports.defer = defer;
//# sourceMappingURL=defer.js.map

1
node_modules/rxjs/internal/observable/defer.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"defer.js","sources":["../../src/internal/observable/defer.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,+BAA8B;AAC9B,iCAAgC;AAmDhC,SAAgB,KAAK,CAAwC,iBAA0B;IACrF,OAAO,IAAI,uBAAU,CAAqB,UAAA,UAAU;QAClD,IAAI,KAAe,CAAC;QACpB,IAAI;YACF,KAAK,GAAG,iBAAiB,EAAE,CAAC;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,OAAO,SAAS,CAAC;SAClB;QACD,IAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,WAAI,CAAC,KAA4C,CAAC,CAAC,CAAC,CAAC,aAAK,EAAE,CAAC;QACpF,OAAO,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAZD,sBAYC"}

View File

@ -0,0 +1,151 @@
import { Observable } from '../../Observable';
import { Subscriber } from '../../Subscriber';
import { TeardownLogic } from '../../types';
export interface AjaxRequest {
url?: string;
body?: any;
user?: string;
async?: boolean;
method?: string;
headers?: Object;
timeout?: number;
password?: string;
hasContent?: boolean;
crossDomain?: boolean;
withCredentials?: boolean;
createXHR?: () => XMLHttpRequest;
progressSubscriber?: Subscriber<any>;
responseType?: string;
}
export interface AjaxCreationMethod {
(urlOrRequest: string | AjaxRequest): Observable<AjaxResponse>;
get(url: string, headers?: Object): Observable<AjaxResponse>;
post(url: string, body?: any, headers?: Object): Observable<AjaxResponse>;
put(url: string, body?: any, headers?: Object): Observable<AjaxResponse>;
patch(url: string, body?: any, headers?: Object): Observable<AjaxResponse>;
delete(url: string, headers?: Object): Observable<AjaxResponse>;
getJSON<T>(url: string, headers?: Object): Observable<T>;
}
export declare function ajaxGet(url: string, headers?: Object): AjaxObservable<AjaxResponse>;
export declare function ajaxPost(url: string, body?: any, headers?: Object): Observable<AjaxResponse>;
export declare function ajaxDelete(url: string, headers?: Object): Observable<AjaxResponse>;
export declare function ajaxPut(url: string, body?: any, headers?: Object): Observable<AjaxResponse>;
export declare function ajaxPatch(url: string, body?: any, headers?: Object): Observable<AjaxResponse>;
export declare function ajaxGetJSON<T>(url: string, headers?: Object): Observable<T>;
/**
* We need this JSDoc comment for affecting ESDoc.
* @extends {Ignored}
* @hide true
*/
export declare class AjaxObservable<T> extends Observable<T> {
/**
* Creates an observable for an Ajax request with either a request object with
* url, headers, etc or a string for a URL.
*
* ## Example
* ```ts
* import { ajax } from 'rxjs/ajax';
*
* const source1 = ajax('/products');
* const source2 = ajax({ url: 'products', method: 'GET' });
* ```
*
* @param {string|Object} request Can be one of the following:
* A string of the URL to make the Ajax call.
* An object with the following properties
* - url: URL of the request
* - body: The body of the request
* - method: Method of the request, such as GET, POST, PUT, PATCH, DELETE
* - async: Whether the request is async
* - headers: Optional headers
* - crossDomain: true if a cross domain request, else false
* - createXHR: a function to override if you need to use an alternate
* XMLHttpRequest implementation.
* - resultSelector: a function to use to alter the output value type of
* the Observable. Gets {@link AjaxResponse} as an argument.
* @return {Observable} An observable sequence containing the XMLHttpRequest.
* @static true
* @name ajax
* @owner Observable
* @nocollapse
*/
static create: AjaxCreationMethod;
private request;
constructor(urlOrRequest: string | AjaxRequest);
/** @deprecated This is an internal implementation detail, do not use. */
_subscribe(subscriber: Subscriber<T>): TeardownLogic;
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
export declare class AjaxSubscriber<T> extends Subscriber<Event> {
request: AjaxRequest;
private xhr;
private done;
constructor(destination: Subscriber<T>, request: AjaxRequest);
next(e: Event): void;
private send;
private serializeBody;
private setHeaders;
private getHeader;
private setupEvents;
unsubscribe(): void;
}
/**
* A normalized AJAX response.
*
* @see {@link ajax}
*
* @class AjaxResponse
*/
export declare class AjaxResponse {
originalEvent: Event;
xhr: XMLHttpRequest;
request: AjaxRequest;
/** @type {number} The HTTP status code */
status: number;
/** @type {string|ArrayBuffer|Document|object|any} The response data */
response: any;
/** @type {string} The raw responseText */
responseText: string;
/** @type {string} The responseType (e.g. 'json', 'arraybuffer', or 'xml') */
responseType: string;
constructor(originalEvent: Event, xhr: XMLHttpRequest, request: AjaxRequest);
}
export declare type AjaxErrorNames = 'AjaxError' | 'AjaxTimeoutError';
/**
* A normalized AJAX error.
*
* @see {@link ajax}
*
* @class AjaxError
*/
export interface AjaxError extends Error {
/** @type {XMLHttpRequest} The XHR instance associated with the error */
xhr: XMLHttpRequest;
/** @type {AjaxRequest} The AjaxRequest associated with the error */
request: AjaxRequest;
/** @type {number} The HTTP status code */
status: number;
/** @type {string} The responseType (e.g. 'json', 'arraybuffer', or 'xml') */
responseType: string;
/** @type {string|ArrayBuffer|Document|object|any} The response data */
response: any;
}
export interface AjaxErrorCtor {
new (message: string, xhr: XMLHttpRequest, request: AjaxRequest): AjaxError;
}
export declare const AjaxError: AjaxErrorCtor;
export interface AjaxTimeoutError extends AjaxError {
}
export interface AjaxTimeoutErrorCtor {
new (xhr: XMLHttpRequest, request: AjaxRequest): AjaxTimeoutError;
}
/**
* @see {@link ajax}
*
* @class AjaxTimeoutError
*/
export declare const AjaxTimeoutError: AjaxTimeoutErrorCtor;

View File

@ -0,0 +1,391 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var root_1 = require("../../util/root");
var Observable_1 = require("../../Observable");
var Subscriber_1 = require("../../Subscriber");
var map_1 = require("../../operators/map");
function getCORSRequest() {
if (root_1.root.XMLHttpRequest) {
return new root_1.root.XMLHttpRequest();
}
else if (!!root_1.root.XDomainRequest) {
return new root_1.root.XDomainRequest();
}
else {
throw new Error('CORS is not supported by your browser');
}
}
function getXMLHttpRequest() {
if (root_1.root.XMLHttpRequest) {
return new root_1.root.XMLHttpRequest();
}
else {
var progId = void 0;
try {
var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
for (var i = 0; i < 3; i++) {
try {
progId = progIds[i];
if (new root_1.root.ActiveXObject(progId)) {
break;
}
}
catch (e) {
}
}
return new root_1.root.ActiveXObject(progId);
}
catch (e) {
throw new Error('XMLHttpRequest is not supported by your browser');
}
}
}
function ajaxGet(url, headers) {
if (headers === void 0) { headers = null; }
return new AjaxObservable({ method: 'GET', url: url, headers: headers });
}
exports.ajaxGet = ajaxGet;
function ajaxPost(url, body, headers) {
return new AjaxObservable({ method: 'POST', url: url, body: body, headers: headers });
}
exports.ajaxPost = ajaxPost;
function ajaxDelete(url, headers) {
return new AjaxObservable({ method: 'DELETE', url: url, headers: headers });
}
exports.ajaxDelete = ajaxDelete;
function ajaxPut(url, body, headers) {
return new AjaxObservable({ method: 'PUT', url: url, body: body, headers: headers });
}
exports.ajaxPut = ajaxPut;
function ajaxPatch(url, body, headers) {
return new AjaxObservable({ method: 'PATCH', url: url, body: body, headers: headers });
}
exports.ajaxPatch = ajaxPatch;
var mapResponse = map_1.map(function (x, index) { return x.response; });
function ajaxGetJSON(url, headers) {
return mapResponse(new AjaxObservable({
method: 'GET',
url: url,
responseType: 'json',
headers: headers
}));
}
exports.ajaxGetJSON = ajaxGetJSON;
var AjaxObservable = (function (_super) {
__extends(AjaxObservable, _super);
function AjaxObservable(urlOrRequest) {
var _this = _super.call(this) || this;
var request = {
async: true,
createXHR: function () {
return this.crossDomain ? getCORSRequest() : getXMLHttpRequest();
},
crossDomain: true,
withCredentials: false,
headers: {},
method: 'GET',
responseType: 'json',
timeout: 0
};
if (typeof urlOrRequest === 'string') {
request.url = urlOrRequest;
}
else {
for (var prop in urlOrRequest) {
if (urlOrRequest.hasOwnProperty(prop)) {
request[prop] = urlOrRequest[prop];
}
}
}
_this.request = request;
return _this;
}
AjaxObservable.prototype._subscribe = function (subscriber) {
return new AjaxSubscriber(subscriber, this.request);
};
AjaxObservable.create = (function () {
var create = function (urlOrRequest) {
return new AjaxObservable(urlOrRequest);
};
create.get = ajaxGet;
create.post = ajaxPost;
create.delete = ajaxDelete;
create.put = ajaxPut;
create.patch = ajaxPatch;
create.getJSON = ajaxGetJSON;
return create;
})();
return AjaxObservable;
}(Observable_1.Observable));
exports.AjaxObservable = AjaxObservable;
var AjaxSubscriber = (function (_super) {
__extends(AjaxSubscriber, _super);
function AjaxSubscriber(destination, request) {
var _this = _super.call(this, destination) || this;
_this.request = request;
_this.done = false;
var headers = request.headers = request.headers || {};
if (!request.crossDomain && !_this.getHeader(headers, 'X-Requested-With')) {
headers['X-Requested-With'] = 'XMLHttpRequest';
}
var contentTypeHeader = _this.getHeader(headers, 'Content-Type');
if (!contentTypeHeader && !(root_1.root.FormData && request.body instanceof root_1.root.FormData) && typeof request.body !== 'undefined') {
headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
}
request.body = _this.serializeBody(request.body, _this.getHeader(request.headers, 'Content-Type'));
_this.send();
return _this;
}
AjaxSubscriber.prototype.next = function (e) {
this.done = true;
var _a = this, xhr = _a.xhr, request = _a.request, destination = _a.destination;
var result;
try {
result = new AjaxResponse(e, xhr, request);
}
catch (err) {
return destination.error(err);
}
destination.next(result);
};
AjaxSubscriber.prototype.send = function () {
var _a = this, request = _a.request, _b = _a.request, user = _b.user, method = _b.method, url = _b.url, async = _b.async, password = _b.password, headers = _b.headers, body = _b.body;
try {
var xhr = this.xhr = request.createXHR();
this.setupEvents(xhr, request);
if (user) {
xhr.open(method, url, async, user, password);
}
else {
xhr.open(method, url, async);
}
if (async) {
xhr.timeout = request.timeout;
xhr.responseType = request.responseType;
}
if ('withCredentials' in xhr) {
xhr.withCredentials = !!request.withCredentials;
}
this.setHeaders(xhr, headers);
if (body) {
xhr.send(body);
}
else {
xhr.send();
}
}
catch (err) {
this.error(err);
}
};
AjaxSubscriber.prototype.serializeBody = function (body, contentType) {
if (!body || typeof body === 'string') {
return body;
}
else if (root_1.root.FormData && body instanceof root_1.root.FormData) {
return body;
}
if (contentType) {
var splitIndex = contentType.indexOf(';');
if (splitIndex !== -1) {
contentType = contentType.substring(0, splitIndex);
}
}
switch (contentType) {
case 'application/x-www-form-urlencoded':
return Object.keys(body).map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(body[key]); }).join('&');
case 'application/json':
return JSON.stringify(body);
default:
return body;
}
};
AjaxSubscriber.prototype.setHeaders = function (xhr, headers) {
for (var key in headers) {
if (headers.hasOwnProperty(key)) {
xhr.setRequestHeader(key, headers[key]);
}
}
};
AjaxSubscriber.prototype.getHeader = function (headers, headerName) {
for (var key in headers) {
if (key.toLowerCase() === headerName.toLowerCase()) {
return headers[key];
}
}
return undefined;
};
AjaxSubscriber.prototype.setupEvents = function (xhr, request) {
var progressSubscriber = request.progressSubscriber;
function xhrTimeout(e) {
var _a = xhrTimeout, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;
if (progressSubscriber) {
progressSubscriber.error(e);
}
var error;
try {
error = new exports.AjaxTimeoutError(this, request);
}
catch (err) {
error = err;
}
subscriber.error(error);
}
xhr.ontimeout = xhrTimeout;
xhrTimeout.request = request;
xhrTimeout.subscriber = this;
xhrTimeout.progressSubscriber = progressSubscriber;
if (xhr.upload && 'withCredentials' in xhr) {
if (progressSubscriber) {
var xhrProgress_1;
xhrProgress_1 = function (e) {
var progressSubscriber = xhrProgress_1.progressSubscriber;
progressSubscriber.next(e);
};
if (root_1.root.XDomainRequest) {
xhr.onprogress = xhrProgress_1;
}
else {
xhr.upload.onprogress = xhrProgress_1;
}
xhrProgress_1.progressSubscriber = progressSubscriber;
}
var xhrError_1;
xhrError_1 = function (e) {
var _a = xhrError_1, progressSubscriber = _a.progressSubscriber, subscriber = _a.subscriber, request = _a.request;
if (progressSubscriber) {
progressSubscriber.error(e);
}
var error;
try {
error = new exports.AjaxError('ajax error', this, request);
}
catch (err) {
error = err;
}
subscriber.error(error);
};
xhr.onerror = xhrError_1;
xhrError_1.request = request;
xhrError_1.subscriber = this;
xhrError_1.progressSubscriber = progressSubscriber;
}
function xhrReadyStateChange(e) {
return;
}
xhr.onreadystatechange = xhrReadyStateChange;
xhrReadyStateChange.subscriber = this;
xhrReadyStateChange.progressSubscriber = progressSubscriber;
xhrReadyStateChange.request = request;
function xhrLoad(e) {
var _a = xhrLoad, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;
if (this.readyState === 4) {
var status_1 = this.status === 1223 ? 204 : this.status;
var response = (this.responseType === 'text' ? (this.response || this.responseText) : this.response);
if (status_1 === 0) {
status_1 = response ? 200 : 0;
}
if (status_1 < 400) {
if (progressSubscriber) {
progressSubscriber.complete();
}
subscriber.next(e);
subscriber.complete();
}
else {
if (progressSubscriber) {
progressSubscriber.error(e);
}
var error = void 0;
try {
error = new exports.AjaxError('ajax error ' + status_1, this, request);
}
catch (err) {
error = err;
}
subscriber.error(error);
}
}
}
xhr.onload = xhrLoad;
xhrLoad.subscriber = this;
xhrLoad.progressSubscriber = progressSubscriber;
xhrLoad.request = request;
};
AjaxSubscriber.prototype.unsubscribe = function () {
var _a = this, done = _a.done, xhr = _a.xhr;
if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {
xhr.abort();
}
_super.prototype.unsubscribe.call(this);
};
return AjaxSubscriber;
}(Subscriber_1.Subscriber));
exports.AjaxSubscriber = AjaxSubscriber;
var AjaxResponse = (function () {
function AjaxResponse(originalEvent, xhr, request) {
this.originalEvent = originalEvent;
this.xhr = xhr;
this.request = request;
this.status = xhr.status;
this.responseType = xhr.responseType || request.responseType;
this.response = parseXhrResponse(this.responseType, xhr);
}
return AjaxResponse;
}());
exports.AjaxResponse = AjaxResponse;
var AjaxErrorImpl = (function () {
function AjaxErrorImpl(message, xhr, request) {
Error.call(this);
this.message = message;
this.name = 'AjaxError';
this.xhr = xhr;
this.request = request;
this.status = xhr.status;
this.responseType = xhr.responseType || request.responseType;
this.response = parseXhrResponse(this.responseType, xhr);
return this;
}
AjaxErrorImpl.prototype = Object.create(Error.prototype);
return AjaxErrorImpl;
})();
exports.AjaxError = AjaxErrorImpl;
function parseJson(xhr) {
if ('response' in xhr) {
return xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null');
}
else {
return JSON.parse(xhr.responseText || 'null');
}
}
function parseXhrResponse(responseType, xhr) {
switch (responseType) {
case 'json':
return parseJson(xhr);
case 'xml':
return xhr.responseXML;
case 'text':
default:
return ('response' in xhr) ? xhr.response : xhr.responseText;
}
}
function AjaxTimeoutErrorImpl(xhr, request) {
exports.AjaxError.call(this, 'ajax timeout', xhr, request);
this.name = 'AjaxTimeoutError';
return this;
}
exports.AjaxTimeoutError = AjaxTimeoutErrorImpl;
//# sourceMappingURL=AjaxObservable.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,170 @@
import { Subject, AnonymousSubject } from '../../Subject';
import { Subscriber } from '../../Subscriber';
import { Observable } from '../../Observable';
import { Subscription } from '../../Subscription';
import { Operator } from '../../Operator';
import { Observer, NextObserver } from '../../types';
/**
* WebSocketSubjectConfig is a plain Object that allows us to make our
* webSocket configurable.
*
* <span class="informal">Provides flexibility to {@link webSocket}</span>
*
* It defines a set of properties to provide custom behavior in specific
* moments of the socket's lifecycle. When the connection opens we can
* use `openObserver`, when the connection is closed `closeObserver`, if we
* are interested in listening for data comming from server: `deserializer`,
* which allows us to customize the deserialization strategy of data before passing it
* to the socket client. By default `deserializer` is going to apply `JSON.parse` to each message comming
* from the Server.
*
* ## Example
* **deserializer**, the default for this property is `JSON.parse` but since there are just two options
* for incomming data, either be text or binarydata. We can apply a custom deserialization strategy
* or just simply skip the default behaviour.
* ```ts
* import { webSocket } from 'rxjs/webSocket';
*
* const wsSubject = webSocket({
* url: 'ws://localhost:8081',
* //Apply any transformation of your choice.
* deserializer: ({data}) => data
* });
*
* wsSubject.subscribe(console.log);
*
* // Let's suppose we have this on the Server: ws.send("This is a msg from the server")
* //output
* //
* // This is a msg from the server
* ```
*
* **serializer** allows us tom apply custom serialization strategy but for the outgoing messages
* ```ts
* import { webSocket } from 'rxjs/webSocket';
*
* const wsSubject = webSocket({
* url: 'ws://localhost:8081',
* //Apply any transformation of your choice.
* serializer: msg => JSON.stringify({channel: "webDevelopment", msg: msg})
* });
*
* wsSubject.subscribe(() => subject.next("msg to the server"));
*
* // Let's suppose we have this on the Server: ws.send("This is a msg from the server")
* //output
* //
* // {"channel":"webDevelopment","msg":"msg to the server"}
* ```
*
* **closeObserver** allows us to set a custom error when an error raise up.
* ```ts
* import { webSocket } from 'rxjs/webSocket';
*
* const wsSubject = webSocket({
* url: 'ws://localhost:8081',
* closeObserver: {
next(closeEvent) {
const customError = { code: 6666, reason: "Custom evil reason" }
console.log(`code: ${customError.code}, reason: ${customError.reason}`);
}
}
* });
*
* //output
* // code: 6666, reason: Custom evil reason
* ```
*
* **openObserver**, Let's say we need to make some kind of init task before sending/receiving msgs to the
* webSocket or sending notification that the connection was successful, this is when
* openObserver is usefull for.
* ```ts
* import { webSocket } from 'rxjs/webSocket';
*
* const wsSubject = webSocket({
* url: 'ws://localhost:8081',
* openObserver: {
* next: () => {
* console.log('connetion ok');
* }
* },
* });
*
* //output
* // connetion ok`
* ```
* */
export interface WebSocketSubjectConfig<T> {
/** The url of the socket server to connect to */
url: string;
/** The protocol to use to connect */
protocol?: string | Array<string>;
/** @deprecated use {@link deserializer} */
resultSelector?: (e: MessageEvent) => T;
/**
* A serializer used to create messages from passed values before the
* messages are sent to the server. Defaults to JSON.stringify.
*/
serializer?: (value: T) => WebSocketMessage;
/**
* A deserializer used for messages arriving on the socket from the
* server. Defaults to JSON.parse.
*/
deserializer?: (e: MessageEvent) => T;
/**
* An Observer that watches when open events occur on the underlying web socket.
*/
openObserver?: NextObserver<Event>;
/**
* An Observer than watches when close events occur on the underlying webSocket
*/
closeObserver?: NextObserver<CloseEvent>;
/**
* An Observer that watches when a close is about to occur due to
* unsubscription.
*/
closingObserver?: NextObserver<void>;
/**
* A WebSocket constructor to use. This is useful for situations like using a
* WebSocket impl in Node (WebSocket is a DOM API), or for mocking a WebSocket
* for testing purposes
*/
WebSocketCtor?: {
new (url: string, protocols?: string | string[]): WebSocket;
};
/** Sets the `binaryType` property of the underlying WebSocket. */
binaryType?: 'blob' | 'arraybuffer';
}
export declare type WebSocketMessage = string | ArrayBuffer | Blob | ArrayBufferView;
export declare class WebSocketSubject<T> extends AnonymousSubject<T> {
private _config;
/** @deprecated This is an internal implementation detail, do not use. */
_output: Subject<T>;
private _socket;
constructor(urlConfigOrSource: string | WebSocketSubjectConfig<T> | Observable<T>, destination?: Observer<T>);
lift<R>(operator: Operator<T, R>): WebSocketSubject<R>;
private _resetState;
/**
* Creates an {@link Observable}, that when subscribed to, sends a message,
* defined by the `subMsg` function, to the server over the socket to begin a
* subscription to data over that socket. Once data arrives, the
* `messageFilter` argument will be used to select the appropriate data for
* the resulting Observable. When teardown occurs, either due to
* unsubscription, completion or error, a message defined by the `unsubMsg`
* argument will be send to the server over the WebSocketSubject.
*
* @param subMsg A function to generate the subscription message to be sent to
* the server. This will still be processed by the serializer in the
* WebSocketSubject's config. (Which defaults to JSON serialization)
* @param unsubMsg A function to generate the unsubscription message to be
* sent to the server at teardown. This will still be processed by the
* serializer in the WebSocketSubject's config.
* @param messageFilter A predicate for selecting the appropriate messages
* from the server for the output stream.
*/
multiplex(subMsg: () => any, unsubMsg: () => any, messageFilter: (value: T) => boolean): Observable<any>;
private _connectSocket;
/** @deprecated This is an internal implementation detail, do not use. */
_subscribe(subscriber: Subscriber<T>): Subscription;
unsubscribe(): void;
}

View File

@ -0,0 +1,241 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var Subject_1 = require("../../Subject");
var Subscriber_1 = require("../../Subscriber");
var Observable_1 = require("../../Observable");
var Subscription_1 = require("../../Subscription");
var ReplaySubject_1 = require("../../ReplaySubject");
var DEFAULT_WEBSOCKET_CONFIG = {
url: '',
deserializer: function (e) { return JSON.parse(e.data); },
serializer: function (value) { return JSON.stringify(value); },
};
var WEBSOCKETSUBJECT_INVALID_ERROR_OBJECT = 'WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }';
var WebSocketSubject = (function (_super) {
__extends(WebSocketSubject, _super);
function WebSocketSubject(urlConfigOrSource, destination) {
var _this = _super.call(this) || this;
if (urlConfigOrSource instanceof Observable_1.Observable) {
_this.destination = destination;
_this.source = urlConfigOrSource;
}
else {
var config = _this._config = __assign({}, DEFAULT_WEBSOCKET_CONFIG);
_this._output = new Subject_1.Subject();
if (typeof urlConfigOrSource === 'string') {
config.url = urlConfigOrSource;
}
else {
for (var key in urlConfigOrSource) {
if (urlConfigOrSource.hasOwnProperty(key)) {
config[key] = urlConfigOrSource[key];
}
}
}
if (!config.WebSocketCtor && WebSocket) {
config.WebSocketCtor = WebSocket;
}
else if (!config.WebSocketCtor) {
throw new Error('no WebSocket constructor can be found');
}
_this.destination = new ReplaySubject_1.ReplaySubject();
}
return _this;
}
WebSocketSubject.prototype.lift = function (operator) {
var sock = new WebSocketSubject(this._config, this.destination);
sock.operator = operator;
sock.source = this;
return sock;
};
WebSocketSubject.prototype._resetState = function () {
this._socket = null;
if (!this.source) {
this.destination = new ReplaySubject_1.ReplaySubject();
}
this._output = new Subject_1.Subject();
};
WebSocketSubject.prototype.multiplex = function (subMsg, unsubMsg, messageFilter) {
var self = this;
return new Observable_1.Observable(function (observer) {
try {
self.next(subMsg());
}
catch (err) {
observer.error(err);
}
var subscription = self.subscribe(function (x) {
try {
if (messageFilter(x)) {
observer.next(x);
}
}
catch (err) {
observer.error(err);
}
}, function (err) { return observer.error(err); }, function () { return observer.complete(); });
return function () {
try {
self.next(unsubMsg());
}
catch (err) {
observer.error(err);
}
subscription.unsubscribe();
};
});
};
WebSocketSubject.prototype._connectSocket = function () {
var _this = this;
var _a = this._config, WebSocketCtor = _a.WebSocketCtor, protocol = _a.protocol, url = _a.url, binaryType = _a.binaryType;
var observer = this._output;
var socket = null;
try {
socket = protocol ?
new WebSocketCtor(url, protocol) :
new WebSocketCtor(url);
this._socket = socket;
if (binaryType) {
this._socket.binaryType = binaryType;
}
}
catch (e) {
observer.error(e);
return;
}
var subscription = new Subscription_1.Subscription(function () {
_this._socket = null;
if (socket && socket.readyState === 1) {
socket.close();
}
});
socket.onopen = function (e) {
var _socket = _this._socket;
if (!_socket) {
socket.close();
_this._resetState();
return;
}
var openObserver = _this._config.openObserver;
if (openObserver) {
openObserver.next(e);
}
var queue = _this.destination;
_this.destination = Subscriber_1.Subscriber.create(function (x) {
if (socket.readyState === 1) {
try {
var serializer = _this._config.serializer;
socket.send(serializer(x));
}
catch (e) {
_this.destination.error(e);
}
}
}, function (e) {
var closingObserver = _this._config.closingObserver;
if (closingObserver) {
closingObserver.next(undefined);
}
if (e && e.code) {
socket.close(e.code, e.reason);
}
else {
observer.error(new TypeError(WEBSOCKETSUBJECT_INVALID_ERROR_OBJECT));
}
_this._resetState();
}, function () {
var closingObserver = _this._config.closingObserver;
if (closingObserver) {
closingObserver.next(undefined);
}
socket.close();
_this._resetState();
});
if (queue && queue instanceof ReplaySubject_1.ReplaySubject) {
subscription.add(queue.subscribe(_this.destination));
}
};
socket.onerror = function (e) {
_this._resetState();
observer.error(e);
};
socket.onclose = function (e) {
_this._resetState();
var closeObserver = _this._config.closeObserver;
if (closeObserver) {
closeObserver.next(e);
}
if (e.wasClean) {
observer.complete();
}
else {
observer.error(e);
}
};
socket.onmessage = function (e) {
try {
var deserializer = _this._config.deserializer;
observer.next(deserializer(e));
}
catch (err) {
observer.error(err);
}
};
};
WebSocketSubject.prototype._subscribe = function (subscriber) {
var _this = this;
var source = this.source;
if (source) {
return source.subscribe(subscriber);
}
if (!this._socket) {
this._connectSocket();
}
this._output.subscribe(subscriber);
subscriber.add(function () {
var _socket = _this._socket;
if (_this._output.observers.length === 0) {
if (_socket && _socket.readyState === 1) {
_socket.close();
}
_this._resetState();
}
});
return subscriber;
};
WebSocketSubject.prototype.unsubscribe = function () {
var _socket = this._socket;
if (_socket && _socket.readyState === 1) {
_socket.close();
}
this._resetState();
_super.prototype.unsubscribe.call(this);
};
return WebSocketSubject;
}(Subject_1.AnonymousSubject));
exports.WebSocketSubject = WebSocketSubject;
//# sourceMappingURL=WebSocketSubject.js.map

File diff suppressed because one or more lines are too long

82
node_modules/rxjs/internal/observable/dom/ajax.d.ts generated vendored Normal file
View File

@ -0,0 +1,82 @@
import { AjaxCreationMethod } from './AjaxObservable';
/**
* There is an ajax operator on the Rx object.
*
* It creates an observable for an Ajax request with either a request object with
* url, headers, etc or a string for a URL.
*
*
* ## Using ajax() to fetch the response object that is being returned from API.
* ```ts
* import { ajax } from 'rxjs/ajax';
* import { map, catchError } from 'rxjs/operators';
* import { of } from 'rxjs';
*
* const obs$ = ajax(`https://api.github.com/users?per_page=5`).pipe(
* map(userResponse => console.log('users: ', userResponse)),
* catchError(error => {
* console.log('error: ', error);
* return of(error);
* })
* );
*
* ```
*
* ## Using ajax.getJSON() to fetch data from API.
* ```ts
* import { ajax } from 'rxjs/ajax';
* import { map, catchError } from 'rxjs/operators';
* import { of } from 'rxjs';
*
* const obs$ = ajax.getJSON(`https://api.github.com/users?per_page=5`).pipe(
* map(userResponse => console.log('users: ', userResponse)),
* catchError(error => {
* console.log('error: ', error);
* return of(error);
* })
* );
*
* ```
*
* ## Using ajax() with object as argument and method POST with a two seconds delay.
* ```ts
* import { ajax } from 'rxjs/ajax';
* import { of } from 'rxjs';
*
* const users = ajax({
* url: 'https://httpbin.org/delay/2',
* method: 'POST',
* headers: {
* 'Content-Type': 'application/json',
* 'rxjs-custom-header': 'Rxjs'
* },
* body: {
* rxjs: 'Hello World!'
* }
* }).pipe(
* map(response => console.log('response: ', response)),
* catchError(error => {
* console.log('error: ', error);
* return of(error);
* })
* );
*
* ```
*
* ## Using ajax() to fetch. An error object that is being returned from the request.
* ```ts
* import { ajax } from 'rxjs/ajax';
* import { map, catchError } from 'rxjs/operators';
* import { of } from 'rxjs';
*
* const obs$ = ajax(`https://api.github.com/404`).pipe(
* map(userResponse => console.log('users: ', userResponse)),
* catchError(error => {
* console.log('error: ', error);
* return of(error);
* })
* );
*
* ```
*/
export declare const ajax: AjaxCreationMethod;

5
node_modules/rxjs/internal/observable/dom/ajax.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var AjaxObservable_1 = require("./AjaxObservable");
exports.ajax = (function () { return AjaxObservable_1.AjaxObservable.create; })();
//# sourceMappingURL=ajax.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ajax.js","sources":["../../../src/internal/observable/dom/ajax.ts"],"names":[],"mappings":";;AAAA,mDAAwE;AAiF3D,QAAA,IAAI,GAAuB,CAAC,cAAM,OAAA,+BAAc,CAAC,MAAM,EAArB,CAAqB,CAAC,EAAE,CAAC"}

6
node_modules/rxjs/internal/observable/dom/fetch.d.ts generated vendored Normal file
View File

@ -0,0 +1,6 @@
import { Observable } from '../../Observable';
import { ObservableInput } from '../../types';
export declare function fromFetch<T>(input: string | Request, init: RequestInit & {
selector: (response: Response) => ObservableInput<T>;
}): Observable<T>;
export declare function fromFetch(input: string | Request, init?: RequestInit): Observable<Response>;

90
node_modules/rxjs/internal/observable/dom/fetch.js generated vendored Normal file
View File

@ -0,0 +1,90 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../../Observable");
var Subscription_1 = require("../../Subscription");
var from_1 = require("../../observable/from");
function fromFetch(input, initWithSelector) {
if (initWithSelector === void 0) { initWithSelector = {}; }
var selector = initWithSelector.selector, init = __rest(initWithSelector, ["selector"]);
return new Observable_1.Observable(function (subscriber) {
var controller = new AbortController();
var signal = controller.signal;
var abortable = true;
var unsubscribed = false;
var subscription = new Subscription_1.Subscription();
subscription.add(function () {
unsubscribed = true;
if (abortable) {
controller.abort();
}
});
var perSubscriberInit;
if (init) {
if (init.signal) {
if (init.signal.aborted) {
controller.abort();
}
else {
var outerSignal_1 = init.signal;
var outerSignalHandler_1 = function () {
if (!signal.aborted) {
controller.abort();
}
};
outerSignal_1.addEventListener('abort', outerSignalHandler_1);
subscription.add(function () { return outerSignal_1.removeEventListener('abort', outerSignalHandler_1); });
}
}
perSubscriberInit = __assign({}, init, { signal: signal });
}
else {
perSubscriberInit = { signal: signal };
}
fetch(input, perSubscriberInit).then(function (response) {
if (selector) {
subscription.add(from_1.from(selector(response)).subscribe(function (value) { return subscriber.next(value); }, function (err) {
abortable = false;
if (!unsubscribed) {
subscriber.error(err);
}
}, function () {
abortable = false;
subscriber.complete();
}));
}
else {
abortable = false;
subscriber.next(response);
subscriber.complete();
}
}).catch(function (err) {
abortable = false;
if (!unsubscribed) {
subscriber.error(err);
}
});
return subscription;
});
}
exports.fromFetch = fromFetch;
//# sourceMappingURL=fetch.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fetch.js","sources":["../../../src/internal/observable/dom/fetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8C;AAC9C,mDAAkD;AAClD,8CAA6C;AA8F7C,SAAgB,SAAS,CACvB,KAAuB,EACvB,gBAEM;IAFN,iCAAA,EAAA,qBAEM;IAEE,IAAA,oCAAQ,EAAE,6CAAO,CAAsB;IAC/C,OAAO,IAAI,uBAAU,CAAe,UAAA,UAAU;QAC5C,IAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QACjC,IAAI,SAAS,GAAG,IAA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SAAS,GAAG,KAAK,CAAC;oBAClB,IAAI,CAAC,YAAY,EAAE;wBAEjB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;qBACvB;gBACH,CAAC,EACD;oBACE,SAAS,GAAG,KAAK,CAAC;oBAClB,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACxB,CAAC,CACF,CAAC,CAAC;aACJ;iBAAM;gBACL,SAAS,GAAG,KAAK,CAAC;gBAClB,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC1B,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvB;QACH,CAAC,CAAC,CAAC,KAAK,CAAC,UAAA,GAAG;YACV,SAAS,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,YAAY,EAAE;gBAEjB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACvB;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC;AA5ED,8BA4EC"}

View File

@ -0,0 +1,153 @@
import { WebSocketSubject, WebSocketSubjectConfig } from './WebSocketSubject';
/**
* Wrapper around the w3c-compatible WebSocket object provided by the browser.
*
* <span class="informal">{@link Subject} that communicates with a server via WebSocket</span>
*
* `webSocket` is a factory function that produces a `WebSocketSubject`,
* which can be used to make WebSocket connection with an arbitrary endpoint.
* `webSocket` accepts as an argument either a string with url of WebSocket endpoint, or an
* {@link WebSocketSubjectConfig} object for providing additional configuration, as
* well as Observers for tracking lifecycle of WebSocket connection.
*
* When `WebSocketSubject` is subscribed, it attempts to make a socket connection,
* unless there is one made already. This means that many subscribers will always listen
* on the same socket, thus saving resources. If however, two instances are made of `WebSocketSubject`,
* even if these two were provided with the same url, they will attempt to make separate
* connections. When consumer of a `WebSocketSubject` unsubscribes, socket connection is closed,
* only if there are no more subscribers still listening. If after some time a consumer starts
* subscribing again, connection is reestablished.
*
* Once connection is made, whenever a new message comes from the server, `WebSocketSubject` will emit that
* message as a value in the stream. By default, a message from the socket is parsed via `JSON.parse`. If you
* want to customize how deserialization is handled (if at all), you can provide custom `resultSelector`
* function in {@link WebSocketSubject}. When connection closes, stream will complete, provided it happened without
* any errors. If at any point (starting, maintaining or closing a connection) there is an error,
* stream will also error with whatever WebSocket API has thrown.
*
* By virtue of being a {@link Subject}, `WebSocketSubject` allows for receiving and sending messages from the server. In order
* to communicate with a connected endpoint, use `next`, `error` and `complete` methods. `next` sends a value to the server, so bear in mind
* that this value will not be serialized beforehand. Because of This, `JSON.stringify` will have to be called on a value by hand,
* before calling `next` with a result. Note also that if at the moment of nexting value
* there is no socket connection (for example no one is subscribing), those values will be buffered, and sent when connection
* is finally established. `complete` method closes socket connection. `error` does the same,
* as well as notifying the server that something went wrong via status code and string with details of what happened.
* Since status code is required in WebSocket API, `WebSocketSubject` does not allow, like regular `Subject`,
* arbitrary values being passed to the `error` method. It needs to be called with an object that has `code`
* property with status code number and optional `reason` property with string describing details
* of an error.
*
* Calling `next` does not affect subscribers of `WebSocketSubject` - they have no
* information that something was sent to the server (unless of course the server
* responds somehow to a message). On the other hand, since calling `complete` triggers
* an attempt to close socket connection. If that connection is closed without any errors, stream will
* complete, thus notifying all subscribers. And since calling `error` closes
* socket connection as well, just with a different status code for the server, if closing itself proceeds
* without errors, subscribed Observable will not error, as one might expect, but complete as usual. In both cases
* (calling `complete` or `error`), if process of closing socket connection results in some errors, *then* stream
* will error.
*
* **Multiplexing**
*
* `WebSocketSubject` has an additional operator, not found in other Subjects. It is called `multiplex` and it is
* used to simulate opening several socket connections, while in reality maintaining only one.
* For example, an application has both chat panel and real-time notifications about sport news. Since these are two distinct functions,
* it would make sense to have two separate connections for each. Perhaps there could even be two separate services with WebSocket
* endpoints, running on separate machines with only GUI combining them together. Having a socket connection
* for each functionality could become too resource expensive. It is a common pattern to have single
* WebSocket endpoint that acts as a gateway for the other services (in this case chat and sport news services).
* Even though there is a single connection in a client app, having the ability to manipulate streams as if it
* were two separate sockets is desirable. This eliminates manually registering and unregistering in a gateway for
* given service and filter out messages of interest. This is exactly what `multiplex` method is for.
*
* Method accepts three parameters. First two are functions returning subscription and unsubscription messages
* respectively. These are messages that will be sent to the server, whenever consumer of resulting Observable
* subscribes and unsubscribes. Server can use them to verify that some kind of messages should start or stop
* being forwarded to the client. In case of the above example application, after getting subscription message with proper identifier,
* gateway server can decide that it should connect to real sport news service and start forwarding messages from it.
* Note that both messages will be sent as returned by the functions, they are by default serialized using JSON.stringify, just
* as messages pushed via `next`. Also bear in mind that these messages will be sent on *every* subscription and
* unsubscription. This is potentially dangerous, because one consumer of an Observable may unsubscribe and the server
* might stop sending messages, since it got unsubscription message. This needs to be handled
* on the server or using {@link publish} on a Observable returned from 'multiplex'.
*
* Last argument to `multiplex` is a `messageFilter` function which should return a boolean. It is used to filter out messages
* sent by the server to only those that belong to simulated WebSocket stream. For example, server might mark these
* messages with some kind of string identifier on a message object and `messageFilter` would return `true`
* if there is such identifier on an object emitted by the socket. Messages which returns `false` in `messageFilter` are simply skipped,
* and are not passed down the stream.
*
* Return value of `multiplex` is an Observable with messages incoming from emulated socket connection. Note that this
* is not a `WebSocketSubject`, so calling `next` or `multiplex` again will fail. For pushing values to the
* server, use root `WebSocketSubject`.
*
* ### Examples
* #### Listening for messages from the server
* ```ts
* import { webSocket } from "rxjs/webSocket";
* const subject = webSocket("ws://localhost:8081");
*
* subject.subscribe(
* msg => console.log('message received: ' + msg), // Called whenever there is a message from the server.
* err => console.log(err), // Called if at any point WebSocket API signals some kind of error.
* () => console.log('complete') // Called when connection is closed (for whatever reason).
* );
* ```
*
* #### Pushing messages to the server
* ```ts
* import { webSocket } from "rxjs/webSocket";
* const subject = webSocket('ws://localhost:8081');
*
* subject.subscribe();
* // Note that at least one consumer has to subscribe to the created subject - otherwise "nexted" values will be just buffered and not sent,
* // since no connection was established!
*
* subject.next({message: 'some message'});
* // This will send a message to the server once a connection is made. Remember value is serialized with JSON.stringify by default!
*
* subject.complete(); // Closes the connection.
*
* subject.error({code: 4000, reason: 'I think our app just broke!'});
* // Also closes the connection, but let's the server know that this closing is caused by some error.
* ```
*
* #### Multiplexing WebSocket
* ```ts
* import { webSocket } from "rxjs/webSocket";
* const subject = webSocket('ws://localhost:8081');
*
* const observableA = subject.multiplex(
* () => ({subscribe: 'A'}), // When server gets this message, it will start sending messages for 'A'...
* () => ({unsubscribe: 'A'}), // ...and when gets this one, it will stop.
* message => message.type === 'A' // If the function returns `true` message is passed down the stream. Skipped if the function returns false.
* );
*
* const observableB = subject.multiplex( // And the same goes for 'B'.
* () => ({subscribe: 'B'}),
* () => ({unsubscribe: 'B'}),
* message => message.type === 'B'
* );
*
* const subA = observableA.subscribe(messageForA => console.log(messageForA));
* // At this moment WebSocket connection is established. Server gets '{"subscribe": "A"}' message and starts sending messages for 'A',
* // which we log here.
*
* const subB = observableB.subscribe(messageForB => console.log(messageForB));
* // Since we already have a connection, we just send '{"subscribe": "B"}' message to the server. It starts sending messages for 'B',
* // which we log here.
*
* subB.unsubscribe();
* // Message '{"unsubscribe": "B"}' is sent to the server, which stops sending 'B' messages.
*
* subA.unsubscribe();
* // Message '{"unsubscribe": "A"}' makes the server stop sending messages for 'A'. Since there is no more subscribers to root Subject,
* // socket connection closes.
* ```
*
*
* @param {string|WebSocketSubjectConfig} urlConfigOrSource The WebSocket endpoint as an url or an object with
* configuration and additional Observers.
* @return {WebSocketSubject} Subject which allows to both send and receive messages via WebSocket connection.
*/
export declare function webSocket<T>(urlConfigOrSource: string | WebSocketSubjectConfig<T>): WebSocketSubject<T>;

View File

@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var WebSocketSubject_1 = require("./WebSocketSubject");
function webSocket(urlConfigOrSource) {
return new WebSocketSubject_1.WebSocketSubject(urlConfigOrSource);
}
exports.webSocket = webSocket;
//# sourceMappingURL=webSocket.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"webSocket.js","sources":["../../../src/internal/observable/dom/webSocket.ts"],"names":[],"mappings":";;AAAA,uDAA8E;AAyJ9E,SAAgB,SAAS,CAAI,iBAAqD;IAChF,OAAO,IAAI,mCAAgB,CAAI,iBAAiB,CAAC,CAAC;AACpD,CAAC;AAFD,8BAEC"}

60
node_modules/rxjs/internal/observable/empty.d.ts generated vendored Normal file
View File

@ -0,0 +1,60 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
/**
* The same Observable instance returned by any call to {@link empty} without a
* `scheduler`. It is preferrable to use this over `empty()`.
*/
export declare const EMPTY: Observable<never>;
/**
* Creates an Observable that emits no items to the Observer and immediately
* emits a complete notification.
*
* <span class="informal">Just emits 'complete', and nothing else.
* </span>
*
* ![](empty.png)
*
* This static operator is useful for creating a simple Observable that only
* emits the complete notification. It can be used for composing with other
* Observables, such as in a {@link mergeMap}.
*
* ## Examples
* ### Emit the number 7, then complete
* ```ts
* import { empty } from 'rxjs';
* import { startWith } from 'rxjs/operators';
*
* const result = empty().pipe(startWith(7));
* result.subscribe(x => console.log(x));
* ```
*
* ### Map and flatten only odd numbers to the sequence 'a', 'b', 'c'
* ```ts
* import { empty, interval, of } from 'rxjs';
* import { mergeMap } from 'rxjs/operators';
*
* const interval$ = interval(1000);
* const result = interval$.pipe(
* mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : empty()),
* );
* result.subscribe(x => console.log(x));
*
* // Results in the following to the console:
* // x is equal to the count on the interval eg(0,1,2,3,...)
* // x will occur every 1000ms
* // if x % 2 is equal to 1 print abc
* // if x % 2 is not equal to 1 nothing will be output
* ```
*
* @see {@link Observable}
* @see {@link never}
* @see {@link of}
* @see {@link throwError}
*
* @param scheduler A {@link SchedulerLike} to use for scheduling
* the emission of the complete notification.
* @return An "empty" Observable: emits only the complete
* notification.
* @deprecated Deprecated in favor of using {@link EMPTY} constant, or {@link scheduled} (e.g. `scheduled([], scheduler)`)
*/
export declare function empty(scheduler?: SchedulerLike): Observable<never>;

12
node_modules/rxjs/internal/observable/empty.js generated vendored Normal file
View File

@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
exports.EMPTY = new Observable_1.Observable(function (subscriber) { return subscriber.complete(); });
function empty(scheduler) {
return scheduler ? emptyScheduled(scheduler) : exports.EMPTY;
}
exports.empty = empty;
function emptyScheduled(scheduler) {
return new Observable_1.Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });
}
//# sourceMappingURL=empty.js.map

1
node_modules/rxjs/internal/observable/empty.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"empty.js","sources":["../../src/internal/observable/empty.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAO9B,QAAA,KAAK,GAAG,IAAI,uBAAU,CAAQ,UAAA,UAAU,IAAI,OAAA,UAAU,CAAC,QAAQ,EAAE,EAArB,CAAqB,CAAC,CAAC;AAsDhF,SAAgB,KAAK,CAAC,SAAyB;IAC7C,OAAO,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAK,CAAC;AACvD,CAAC;AAFD,sBAEC;AAED,SAAS,cAAc,CAAC,SAAwB;IAC9C,OAAO,IAAI,uBAAU,CAAQ,UAAA,UAAU,IAAI,OAAA,SAAS,CAAC,QAAQ,CAAC,cAAM,OAAA,UAAU,CAAC,QAAQ,EAAE,EAArB,CAAqB,CAAC,EAA/C,CAA+C,CAAC,CAAC;AAC9F,CAAC"}

29
node_modules/rxjs/internal/observable/forkJoin.d.ts generated vendored Normal file
View File

@ -0,0 +1,29 @@
import { Observable } from '../Observable';
import { ObservableInput, ObservedValuesFromArray, ObservedValueOf, SubscribableOrPromise } from '../types';
/** @deprecated Use the version that takes an array of Observables instead */
export declare function forkJoin<T>(v1: SubscribableOrPromise<T>): Observable<[T]>;
/** @deprecated Use the version that takes an array of Observables instead */
export declare function forkJoin<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>): Observable<[T, T2]>;
/** @deprecated Use the version that takes an array of Observables instead */
export declare function forkJoin<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<[T, T2, T3]>;
/** @deprecated Use the version that takes an array of Observables instead */
export declare function forkJoin<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<[T, T2, T3, T4]>;
/** @deprecated Use the version that takes an array of Observables instead */
export declare function forkJoin<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<[T, T2, T3, T4, T5]>;
/** @deprecated Use the version that takes an array of Observables instead */
export declare function forkJoin<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<[T, T2, T3, T4, T5, T6]>;
export declare function forkJoin<A>(sources: [ObservableInput<A>]): Observable<[A]>;
export declare function forkJoin<A, B>(sources: [ObservableInput<A>, ObservableInput<B>]): Observable<[A, B]>;
export declare function forkJoin<A, B, C>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>]): Observable<[A, B, C]>;
export declare function forkJoin<A, B, C, D>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>]): Observable<[A, B, C, D]>;
export declare function forkJoin<A, B, C, D, E>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>, ObservableInput<E>]): Observable<[A, B, C, D, E]>;
export declare function forkJoin<A, B, C, D, E, F>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>, ObservableInput<E>, ObservableInput<F>]): Observable<[A, B, C, D, E, F]>;
export declare function forkJoin<A extends ObservableInput<any>[]>(sources: A): Observable<ObservedValuesFromArray<A>[]>;
export declare function forkJoin(sourcesObject: {}): Observable<never>;
export declare function forkJoin<T, K extends keyof T>(sourcesObject: T): Observable<{
[K in keyof T]: ObservedValueOf<T[K]>;
}>;
/** @deprecated resultSelector is deprecated, pipe to map instead */
export declare function forkJoin(...args: Array<ObservableInput<any> | Function>): Observable<any>;
/** @deprecated Use the version that takes an array of Observables instead */
export declare function forkJoin<T>(...sources: ObservableInput<T>[]): Observable<T[]>;

71
node_modules/rxjs/internal/observable/forkJoin.js generated vendored Normal file
View File

@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var isArray_1 = require("../util/isArray");
var map_1 = require("../operators/map");
var isObject_1 = require("../util/isObject");
var from_1 = require("./from");
function forkJoin() {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
if (sources.length === 1) {
var first_1 = sources[0];
if (isArray_1.isArray(first_1)) {
return forkJoinInternal(first_1, null);
}
if (isObject_1.isObject(first_1) && Object.getPrototypeOf(first_1) === Object.prototype) {
var keys = Object.keys(first_1);
return forkJoinInternal(keys.map(function (key) { return first_1[key]; }), keys);
}
}
if (typeof sources[sources.length - 1] === 'function') {
var resultSelector_1 = sources.pop();
sources = (sources.length === 1 && isArray_1.isArray(sources[0])) ? sources[0] : sources;
return forkJoinInternal(sources, null).pipe(map_1.map(function (args) { return resultSelector_1.apply(void 0, args); }));
}
return forkJoinInternal(sources, null);
}
exports.forkJoin = forkJoin;
function forkJoinInternal(sources, keys) {
return new Observable_1.Observable(function (subscriber) {
var len = sources.length;
if (len === 0) {
subscriber.complete();
return;
}
var values = new Array(len);
var completed = 0;
var emitted = 0;
var _loop_1 = function (i) {
var source = from_1.from(sources[i]);
var hasValue = false;
subscriber.add(source.subscribe({
next: function (value) {
if (!hasValue) {
hasValue = true;
emitted++;
}
values[i] = value;
},
error: function (err) { return subscriber.error(err); },
complete: function () {
completed++;
if (completed === len || !hasValue) {
if (emitted === len) {
subscriber.next(keys ?
keys.reduce(function (result, key, i) { return (result[key] = values[i], result); }, {}) :
values);
}
subscriber.complete();
}
}
}));
};
for (var i = 0; i < len; i++) {
_loop_1(i);
}
});
}
//# sourceMappingURL=forkJoin.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"forkJoin.js","sources":["../../src/internal/observable/forkJoin.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,2CAA0C;AAC1C,wCAAuC;AACvC,6CAA4C;AAE5C,+BAA8B;AAsI9B,SAAgB,QAAQ;IACtB,iBAAiB;SAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;QAAjB,4BAAiB;;IAEjB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,IAAM,OAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,iBAAO,CAAC,OAAK,CAAC,EAAE;YAClB,OAAO,gBAAgB,CAAC,OAAK,EAAE,IAAI,CAAC,CAAC;SACtC;QAED,IAAI,mBAAQ,CAAC,OAAK,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,OAAK,CAAC,KAAK,MAAM,CAAC,SAAS,EAAE;YACxE,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAK,CAAC,CAAC;YAChC,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,OAAK,CAAC,GAAG,CAAC,EAAV,CAAU,CAAC,EAAE,IAAI,CAAC,CAAC;SAC5D;KACF;IAGD,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,UAAU,EAAE;QACrD,IAAM,gBAAc,GAAG,OAAO,CAAC,GAAG,EAAc,CAAC;QACjD,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,iBAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC/E,OAAO,gBAAgB,CAAC,O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I,CAAC,MAAM,CAAC,UAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAK,OAAA,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAjC,CAAiC,EAAE,EAAE,CAAC,CAAC,CAAC;gCACxE,MAAM,CAAC,CAAC;yBACX;wBACD,UAAU,CAAC,QAAQ,EAAE,CAAC;qBACvB;gBACH,CAAC;aACF,CAAC,CAAC,CAAC;QACN,CAAC;QAxBD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE;oBAAnB,CAAC;SAwBT;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}

5
node_modules/rxjs/internal/observable/from.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
import { Observable } from '../Observable';
import { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';
export declare function from<O extends ObservableInput<any>>(input: O): Observable<ObservedValueOf<O>>;
/** @deprecated use {@link scheduled} instead. */
export declare function from<O extends ObservableInput<any>>(input: O, scheduler: SchedulerLike): Observable<ObservedValueOf<O>>;

18
node_modules/rxjs/internal/observable/from.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var subscribeTo_1 = require("../util/subscribeTo");
var scheduled_1 = require("../scheduled/scheduled");
function from(input, scheduler) {
if (!scheduler) {
if (input instanceof Observable_1.Observable) {
return input;
}
return new Observable_1.Observable(subscribeTo_1.subscribeTo(input));
}
else {
return scheduled_1.scheduled(input, scheduler);
}
}
exports.from = from;
//# sourceMappingURL=from.js.map

1
node_modules/rxjs/internal/observable/from.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"from.js","sources":["../../src/internal/observable/from.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAC3C,mDAAkD;AAElD,oDAAmD;AAyGnD,SAAgB,IAAI,CAAI,KAAyB,EAAE,SAAyB;IAC1E,IAAI,CAAC,SAAS,EAAE;QACd,IAAI,KAAK,YAAY,uBAAU,EAAE;YAC/B,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,uBAAU,CAAI,yBAAW,CAAC,KAAK,CAAC,CAAC,CAAC;KAC9C;SAAM;QACL,OAAO,qBAAS,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;KACpC;AACH,CAAC;AATD,oBASC"}

3
node_modules/rxjs/internal/observable/fromArray.d.ts generated vendored Normal file
View File

@ -0,0 +1,3 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
export declare function fromArray<T>(input: ArrayLike<T>, scheduler?: SchedulerLike): Observable<T>;

15
node_modules/rxjs/internal/observable/fromArray.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var subscribeToArray_1 = require("../util/subscribeToArray");
var scheduleArray_1 = require("../scheduled/scheduleArray");
function fromArray(input, scheduler) {
if (!scheduler) {
return new Observable_1.Observable(subscribeToArray_1.subscribeToArray(input));
}
else {
return scheduleArray_1.scheduleArray(input, scheduler);
}
}
exports.fromArray = fromArray;
//# sourceMappingURL=fromArray.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fromArray.js","sources":["../../src/internal/observable/fromArray.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,6DAA4D;AAC5D,4DAA2D;AAE3D,SAAgB,SAAS,CAAI,KAAmB,EAAE,SAAyB;IACzE,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,IAAI,uBAAU,CAAI,mCAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;KACnD;SAAM;QACL,OAAO,6BAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;KACxC;AACH,CAAC;AAND,8BAMC"}

35
node_modules/rxjs/internal/observable/fromEvent.d.ts generated vendored Normal file
View File

@ -0,0 +1,35 @@
import { Observable } from '../Observable';
export interface NodeStyleEventEmitter {
addListener: (eventName: string | symbol, handler: NodeEventHandler) => this;
removeListener: (eventName: string | symbol, handler: NodeEventHandler) => this;
}
export declare type NodeEventHandler = (...args: any[]) => void;
export interface NodeCompatibleEventEmitter {
addListener: (eventName: string, handler: NodeEventHandler) => void | {};
removeListener: (eventName: string, handler: NodeEventHandler) => void | {};
}
export interface JQueryStyleEventEmitter {
on: (eventName: string, handler: Function) => void;
off: (eventName: string, handler: Function) => void;
}
export interface HasEventTargetAddRemove<E> {
addEventListener(type: string, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void;
removeEventListener(type: string, listener?: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void;
}
export declare type EventTargetLike<T> = HasEventTargetAddRemove<T> | NodeStyleEventEmitter | NodeCompatibleEventEmitter | JQueryStyleEventEmitter;
export declare type FromEventTarget<T> = EventTargetLike<T> | ArrayLike<EventTargetLike<T>>;
export interface EventListenerOptions {
capture?: boolean;
passive?: boolean;
once?: boolean;
}
export interface AddEventListenerOptions extends EventListenerOptions {
once?: boolean;
passive?: boolean;
}
export declare function fromEvent<T>(target: FromEventTarget<T>, eventName: string): Observable<T>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function fromEvent<T>(target: FromEventTarget<T>, eventName: string, resultSelector: (...args: any[]) => T): Observable<T>;
export declare function fromEvent<T>(target: FromEventTarget<T>, eventName: string, options: EventListenerOptions): Observable<T>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function fromEvent<T>(target: FromEventTarget<T>, eventName: string, options: EventListenerOptions, resultSelector: (...args: any[]) => T): Observable<T>;

65
node_modules/rxjs/internal/observable/fromEvent.js generated vendored Normal file
View File

@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var isArray_1 = require("../util/isArray");
var isFunction_1 = require("../util/isFunction");
var map_1 = require("../operators/map");
var toString = (function () { return Object.prototype.toString; })();
function fromEvent(target, eventName, options, resultSelector) {
if (isFunction_1.isFunction(options)) {
resultSelector = options;
options = undefined;
}
if (resultSelector) {
return fromEvent(target, eventName, options).pipe(map_1.map(function (args) { return isArray_1.isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
}
return new Observable_1.Observable(function (subscriber) {
function handler(e) {
if (arguments.length > 1) {
subscriber.next(Array.prototype.slice.call(arguments));
}
else {
subscriber.next(e);
}
}
setupSubscription(target, eventName, handler, subscriber, options);
});
}
exports.fromEvent = fromEvent;
function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
var unsubscribe;
if (isEventTarget(sourceObj)) {
var source_1 = sourceObj;
sourceObj.addEventListener(eventName, handler, options);
unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };
}
else if (isJQueryStyleEventEmitter(sourceObj)) {
var source_2 = sourceObj;
sourceObj.on(eventName, handler);
unsubscribe = function () { return source_2.off(eventName, handler); };
}
else if (isNodeStyleEventEmitter(sourceObj)) {
var source_3 = sourceObj;
sourceObj.addListener(eventName, handler);
unsubscribe = function () { return source_3.removeListener(eventName, handler); };
}
else if (sourceObj && sourceObj.length) {
for (var i = 0, len = sourceObj.length; i < len; i++) {
setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
}
}
else {
throw new TypeError('Invalid event target');
}
subscriber.add(unsubscribe);
}
function isNodeStyleEventEmitter(sourceObj) {
return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
}
function isJQueryStyleEventEmitter(sourceObj) {
return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
}
function isEventTarget(sourceObj) {
return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
}
//# sourceMappingURL=fromEvent.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fromEvent.js","sources":["../../src/internal/observable/fromEvent.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAC3C,2CAA0C;AAC1C,iDAAgD;AAEhD,wCAAuC;AAEvC,IAAM,QA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AAyB,CAAC,SAAc;IAC/C,OAAO,SAAS,IAAI,OAAO,SAAS,CAAC,EAAE,KAAK,UAAU,IAAI,OAAO,SAAS,CAAC,GAAG,KAAK,UAAU,CAAC;AAChG,CAAC;AAED,SAAS,aAAa,CAAC,SAAc;IACnC,OAAO,SAAS,IAAI,OAAO,SAAS,CAAC,gBAAgB,KAAK,UAAU,IAAI,OAAO,SAAS,CAAC,mBAAmB,KAAK,UAAU,CAAC;AAC9H,CAAC"}

View File

@ -0,0 +1,5 @@
import { Observable } from '../Observable';
import { NodeEventHandler } from './fromEvent';
export declare function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void): Observable<T>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export declare function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void, resultSelector?: (...args: any[]) => T): Observable<T>;

View File

@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var isArray_1 = require("../util/isArray");
var isFunction_1 = require("../util/isFunction");
var map_1 = require("../operators/map");
function fromEventPattern(addHandler, removeHandler, resultSelector) {
if (resultSelector) {
return fromEventPattern(addHandler, removeHandler).pipe(map_1.map(function (args) { return isArray_1.isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
}
return new Observable_1.Observable(function (subscriber) {
var handler = function () {
var e = [];
for (var _i = 0; _i < arguments.length; _i++) {
e[_i] = arguments[_i];
}
return subscriber.next(e.length === 1 ? e[0] : e);
};
var retValue;
try {
retValue = addHandler(handler);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (!isFunction_1.isFunction(removeHandler)) {
return undefined;
}
return function () { return removeHandler(handler, retValue); };
});
}
exports.fromEventPattern = fromEventPattern;
//# sourceMappingURL=fromEventPattern.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fromEventPattern.js","sources":["../../src/internal/observable/fromEventPattern.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAC3C,2CAA0C;AAC1C,iDAAgD;AAEhD,wCAAuC;AAwIvC,SAAgB,gBAAgB,CAAI,UAA8C,EAC9C,aAAiE,EACjE,cAAsC;IAExE,IAAI,cAAc,EAAE;QAElB,OAAO,gBAAgB,CAAI,UAAU,EAAE,aAAa,CAAC,CAAC,IAAI,CACxD,SAAG,CAAC,UAAA,IAAI,IAAI,OAAA,iBAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,eAAI,IAAI,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,EAA9D,CAA8D,CAAC,CAC5E,CAAC;KACH;IAED,OAAO,IAAI,uBAAU,CAAU,UAAA,UAAU;QACvC,IAAM,OAAO,GAAG;YAAC,WAAS;iBAAT,UAAS,EAAT,qBAAS,EAAT,IAAS;gBAAT,sBAAS;;YAAK,OAAA,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAA1C,CAA0C,CAAC;QAE1E,IAAI,QAAa,CAAC;QAClB,IAAI;YACF,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;SAChC;QAAC,OAAO,GAAG,EAAE;YACZ,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,CAAC,uBAAU,CAAC,aAAa,CAAC,EAAE;YAC9B,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,cAAM,OAAA,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAhC,CAAgC,CAAE;IACjD,CAAC,CAAC,CAAC;AACL,CAAC;AA5BD,4CA4BC"}

View File

@ -0,0 +1,3 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
export declare function fromIterable<T>(input: Iterable<T>, scheduler?: SchedulerLike): Observable<T>;

18
node_modules/rxjs/internal/observable/fromIterable.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var subscribeToIterable_1 = require("../util/subscribeToIterable");
var scheduleIterable_1 = require("../scheduled/scheduleIterable");
function fromIterable(input, scheduler) {
if (!input) {
throw new Error('Iterable cannot be null');
}
if (!scheduler) {
return new Observable_1.Observable(subscribeToIterable_1.subscribeToIterable(input));
}
else {
return scheduleIterable_1.scheduleIterable(input, scheduler);
}
}
exports.fromIterable = fromIterable;
//# sourceMappingURL=fromIterable.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fromIterable.js","sources":["../../src/internal/observable/fromIterable.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,mEAAkE;AAClE,kEAAiE;AAEjE,SAAgB,YAAY,CAAI,KAAkB,EAAE,SAAyB;IAC3E,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC5C;IACD,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,IAAI,uBAAU,CAAI,yCAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;KACtD;SAAM;QACL,OAAO,mCAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;KAC3C;AACH,CAAC;AATD,oCASC"}

View File

@ -0,0 +1,3 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
export declare function fromPromise<T>(input: PromiseLike<T>, scheduler?: SchedulerLike): Observable<T>;

15
node_modules/rxjs/internal/observable/fromPromise.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var subscribeToPromise_1 = require("../util/subscribeToPromise");
var schedulePromise_1 = require("../scheduled/schedulePromise");
function fromPromise(input, scheduler) {
if (!scheduler) {
return new Observable_1.Observable(subscribeToPromise_1.subscribeToPromise(input));
}
else {
return schedulePromise_1.schedulePromise(input, scheduler);
}
}
exports.fromPromise = fromPromise;
//# sourceMappingURL=fromPromise.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"fromPromise.js","sources":["../../src/internal/observable/fromPromise.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,iEAAgE;AAChE,gEAA+D;AAE/D,SAAgB,WAAW,CAAI,KAAqB,EAAE,SAAyB;IAC7E,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,IAAI,uBAAU,CAAI,uCAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;KACrD;SAAM;QACL,OAAO,iCAAe,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;KAC1C;AACH,CAAC;AAND,kCAMC"}

231
node_modules/rxjs/internal/observable/generate.d.ts generated vendored Normal file
View File

@ -0,0 +1,231 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
export declare type ConditionFunc<S> = (state: S) => boolean;
export declare type IterateFunc<S> = (state: S) => S;
export declare type ResultFunc<S, T> = (state: S) => T;
export interface GenerateBaseOptions<S> {
/**
* Initial state.
*/
initialState: S;
/**
* Condition function that accepts state and returns boolean.
* When it returns false, the generator stops.
* If not specified, a generator never stops.
*/
condition?: ConditionFunc<S>;
/**
* Iterate function that accepts state and returns new state.
*/
iterate: IterateFunc<S>;
/**
* SchedulerLike to use for generation process.
* By default, a generator starts immediately.
*/
scheduler?: SchedulerLike;
}
export interface GenerateOptions<T, S> extends GenerateBaseOptions<S> {
/**
* Result selection function that accepts state and returns a value to emit.
*/
resultSelector: ResultFunc<S, T>;
}
/**
* Generates an observable sequence by running a state-driven loop
* producing the sequence's elements, using the specified scheduler
* to send out observer messages.
*
* ![](generate.png)
*
* @example <caption>Produces sequence of 0, 1, 2, ... 9, then completes.</caption>
* const res = generate(0, x => x < 10, x => x + 1, x => x);
*
* @example <caption>Using asap scheduler, produces sequence of 2, 3, 5, then completes.</caption>
* const res = generate(1, x => x < 5, x => x * 2, x => x + 1, asap);
*
* @see {@link from}
* @see {@link Observable}
*
* @param {S} initialState Initial state.
* @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).
* @param {function (state: S): S} iterate Iteration step function.
* @param {function (state: S): T} resultSelector Selector function for results produced in the sequence. (deprecated)
* @param {SchedulerLike} [scheduler] A {@link SchedulerLike} on which to run the generator loop. If not provided, defaults to emit immediately.
* @returns {Observable<T>} The generated sequence.
*/
export declare function generate<T, S>(initialState: S, condition: ConditionFunc<S>, iterate: IterateFunc<S>, resultSelector: ResultFunc<S, T>, scheduler?: SchedulerLike): Observable<T>;
/**
* Generates an Observable by running a state-driven loop
* that emits an element on each iteration.
*
* <span class="informal">Use it instead of nexting values in a for loop.</span>
*
* <img src="./img/generate.png" width="100%">
*
* `generate` allows you to create stream of values generated with a loop very similar to
* traditional for loop. First argument of `generate` is a beginning value. Second argument
* is a function that accepts this value and tests if some condition still holds. If it does,
* loop continues, if not, it stops. Third value is a function which takes previously defined
* value and modifies it in some way on each iteration. Note how these three parameters
* are direct equivalents of three expressions in regular for loop: first expression
* initializes some state (for example numeric index), second tests if loop can make next
* iteration (for example if index is lower than 10) and third states how defined value
* will be modified on every step (index will be incremented by one).
*
* Return value of a `generate` operator is an Observable that on each loop iteration
* emits a value. First, condition function is ran. If it returned true, Observable
* emits currently stored value (initial value at the first iteration) and then updates
* that value with iterate function. If at some point condition returned false, Observable
* completes at that moment.
*
* Optionally you can pass fourth parameter to `generate` - a result selector function which allows you
* to immediately map value that would normally be emitted by an Observable.
*
* If you find three anonymous functions in `generate` call hard to read, you can provide
* single object to the operator instead. That object has properties: `initialState`,
* `condition`, `iterate` and `resultSelector`, which should have respective values that you
* would normally pass to `generate`. `resultSelector` is still optional, but that form
* of calling `generate` allows you to omit `condition` as well. If you omit it, that means
* condition always holds, so output Observable will never complete.
*
* Both forms of `generate` can optionally accept a scheduler. In case of multi-parameter call,
* scheduler simply comes as a last argument (no matter if there is resultSelector
* function or not). In case of single-parameter call, you can provide it as a
* `scheduler` property on object passed to the operator. In both cases scheduler decides when
* next iteration of the loop will happen and therefore when next value will be emitted
* by the Observable. For example to ensure that each value is pushed to the observer
* on separate task in event loop, you could use `async` scheduler. Note that
* by default (when no scheduler is passed) values are simply emitted synchronously.
*
*
* @example <caption>Use with condition and iterate functions.</caption>
* const generated = generate(0, x => x < 3, x => x + 1);
*
* generated.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('Yo!')
* );
*
* // Logs:
* // 0
* // 1
* // 2
* // "Yo!"
*
*
* @example <caption>Use with condition, iterate and resultSelector functions.</caption>
* const generated = generate(0, x => x < 3, x => x + 1, x => x * 1000);
*
* generated.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('Yo!')
* );
*
* // Logs:
* // 0
* // 1000
* // 2000
* // "Yo!"
*
*
* @example <caption>Use with options object.</caption>
* const generated = generate({
* initialState: 0,
* condition(value) { return value < 3; },
* iterate(value) { return value + 1; },
* resultSelector(value) { return value * 1000; }
* });
*
* generated.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('Yo!')
* );
*
* // Logs:
* // 0
* // 1000
* // 2000
* // "Yo!"
*
* @example <caption>Use options object without condition function.</caption>
* const generated = generate({
* initialState: 0,
* iterate(value) { return value + 1; },
* resultSelector(value) { return value * 1000; }
* });
*
* generated.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('Yo!') // This will never run.
* );
*
* // Logs:
* // 0
* // 1000
* // 2000
* // 3000
* // ...and never stops.
*
*
* @see {@link from}
* @see {@link index/Observable.create}
*
* @param {S} initialState Initial state.
* @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).
* @param {function (state: S): S} iterate Iteration step function.
* @param {function (state: S): T} [resultSelector] Selector function for results produced in the sequence.
* @param {Scheduler} [scheduler] A {@link Scheduler} on which to run the generator loop. If not provided, defaults to emitting immediately.
* @return {Observable<T>} The generated sequence.
*/
export declare function generate<S>(initialState: S, condition: ConditionFunc<S>, iterate: IterateFunc<S>, scheduler?: SchedulerLike): Observable<S>;
/**
* Generates an observable sequence by running a state-driven loop
* producing the sequence's elements, using the specified scheduler
* to send out observer messages.
* The overload accepts options object that might contain initial state, iterate,
* condition and scheduler.
*
* ![](generate.png)
*
* @example <caption>Produces sequence of 0, 1, 2, ... 9, then completes.</caption>
* const res = generate({
* initialState: 0,
* condition: x => x < 10,
* iterate: x => x + 1,
* });
*
* @see {@link from}
* @see {@link Observable}
*
* @param {GenerateBaseOptions<S>} options Object that must contain initialState, iterate and might contain condition and scheduler.
* @returns {Observable<S>} The generated sequence.
*/
export declare function generate<S>(options: GenerateBaseOptions<S>): Observable<S>;
/**
* Generates an observable sequence by running a state-driven loop
* producing the sequence's elements, using the specified scheduler
* to send out observer messages.
* The overload accepts options object that might contain initial state, iterate,
* condition, result selector and scheduler.
*
* ![](generate.png)
*
* @example <caption>Produces sequence of 0, 1, 2, ... 9, then completes.</caption>
* const res = generate({
* initialState: 0,
* condition: x => x < 10,
* iterate: x => x + 1,
* resultSelector: x => x,
* });
*
* @see {@link from}
* @see {@link Observable}
*
* @param {GenerateOptions<T, S>} options Object that must contain initialState, iterate, resultSelector and might contain condition and scheduler.
* @returns {Observable<T>} The generated sequence.
*/
export declare function generate<T, S>(options: GenerateOptions<T, S>): Observable<T>;

127
node_modules/rxjs/internal/observable/generate.js generated vendored Normal file
View File

@ -0,0 +1,127 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var identity_1 = require("../util/identity");
var isScheduler_1 = require("../util/isScheduler");
function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
var resultSelector;
var initialState;
if (arguments.length == 1) {
var options = initialStateOrOptions;
initialState = options.initialState;
condition = options.condition;
iterate = options.iterate;
resultSelector = options.resultSelector || identity_1.identity;
scheduler = options.scheduler;
}
else if (resultSelectorOrObservable === undefined || isScheduler_1.isScheduler(resultSelectorOrObservable)) {
initialState = initialStateOrOptions;
resultSelector = identity_1.identity;
scheduler = resultSelectorOrObservable;
}
else {
initialState = initialStateOrOptions;
resultSelector = resultSelectorOrObservable;
}
return new Observable_1.Observable(function (subscriber) {
var state = initialState;
if (scheduler) {
return scheduler.schedule(dispatch, 0, {
subscriber: subscriber,
iterate: iterate,
condition: condition,
resultSelector: resultSelector,
state: state
});
}
do {
if (condition) {
var conditionResult = void 0;
try {
conditionResult = condition(state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (!conditionResult) {
subscriber.complete();
break;
}
}
var value = void 0;
try {
value = resultSelector(state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
subscriber.next(value);
if (subscriber.closed) {
break;
}
try {
state = iterate(state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
} while (true);
return undefined;
});
}
exports.generate = generate;
function dispatch(state) {
var subscriber = state.subscriber, condition = state.condition;
if (subscriber.closed) {
return undefined;
}
if (state.needIterate) {
try {
state.state = state.iterate(state.state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
}
else {
state.needIterate = true;
}
if (condition) {
var conditionResult = void 0;
try {
conditionResult = condition(state.state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (!conditionResult) {
subscriber.complete();
return undefined;
}
if (subscriber.closed) {
return undefined;
}
}
var value;
try {
value = state.resultSelector(state.state);
}
catch (err) {
subscriber.error(err);
return undefined;
}
if (subscriber.closed) {
return undefined;
}
subscriber.next(value);
if (subscriber.closed) {
return undefined;
}
return this.schedule(state);
}
//# sourceMappingURL=generate.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"generate.js","sources":["../../src/internal/observable/generate.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,6CAA4C;AAE5C,mDAAkD;AA8PlD,SAAgB,QAAQ,CAAO,qBAAgD,EAChD,SAA4B,EAC5B,OAAwB,EACxB,0BAA+D,EAC/D,SAAyB;IAEtD,IAAI,cAAgC,CAAC;IACrC,IAAI,YAAe,CAAC;IAEpB,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE;QACzB,IAAM,OAAO,GAAG,qBAA8C,CAAC;QAC/D,YAAY,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rB,OAAO,SAAS,CAAC;SAClB;KACF;IACD,IAAI,KAAQ,CAAC;IACb,IAAI;QACF,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC3C;IAAC,OAAO,GAAG,EAAE;QACZ,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}

91
node_modules/rxjs/internal/observable/iif.d.ts generated vendored Normal file
View File

@ -0,0 +1,91 @@
import { Observable } from '../Observable';
import { SubscribableOrPromise } from '../types';
/**
* Decides at subscription time which Observable will actually be subscribed.
*
* <span class="informal">`If` statement for Observables.</span>
*
* `iif` accepts a condition function and two Observables. When
* an Observable returned by the operator is subscribed, condition function will be called.
* Based on what boolean it returns at that moment, consumer will subscribe either to
* the first Observable (if condition was true) or to the second (if condition was false). Condition
* function may also not return anything - in that case condition will be evaluated as false and
* second Observable will be subscribed.
*
* Note that Observables for both cases (true and false) are optional. If condition points to an Observable that
* was left undefined, resulting stream will simply complete immediately. That allows you to, rather
* than controlling which Observable will be subscribed, decide at runtime if consumer should have access
* to given Observable or not.
*
* If you have more complex logic that requires decision between more than two Observables, {@link defer}
* will probably be a better choice. Actually `iif` can be easily implemented with {@link defer}
* and exists only for convenience and readability reasons.
*
*
* ## Examples
* ### Change at runtime which Observable will be subscribed
* ```ts
* import { iif, of } from 'rxjs';
*
* let subscribeToFirst;
* const firstOrSecond = iif(
* () => subscribeToFirst,
* of('first'),
* of('second'),
* );
*
* subscribeToFirst = true;
* firstOrSecond.subscribe(value => console.log(value));
*
* // Logs:
* // "first"
*
* subscribeToFirst = false;
* firstOrSecond.subscribe(value => console.log(value));
*
* // Logs:
* // "second"
*
* ```
*
* ### Control an access to an Observable
* ```ts
* let accessGranted;
* const observableIfYouHaveAccess = iif(
* () => accessGranted,
* of('It seems you have an access...'), // Note that only one Observable is passed to the operator.
* );
*
* accessGranted = true;
* observableIfYouHaveAccess.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('The end'),
* );
*
* // Logs:
* // "It seems you have an access..."
* // "The end"
*
* accessGranted = false;
* observableIfYouHaveAccess.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('The end'),
* );
*
* // Logs:
* // "The end"
* ```
*
* @see {@link defer}
*
* @param {function(): boolean} condition Condition which Observable should be chosen.
* @param {Observable} [trueObservable] An Observable that will be subscribed if condition is true.
* @param {Observable} [falseObservable] An Observable that will be subscribed if condition is false.
* @return {Observable} Either first or second Observable, depending on condition.
* @static true
* @name iif
* @owner Observable
*/
export declare function iif<T = never, F = never>(condition: () => boolean, trueResult?: SubscribableOrPromise<T>, falseResult?: SubscribableOrPromise<F>): Observable<T | F>;

11
node_modules/rxjs/internal/observable/iif.js generated vendored Normal file
View File

@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var defer_1 = require("./defer");
var empty_1 = require("./empty");
function iif(condition, trueResult, falseResult) {
if (trueResult === void 0) { trueResult = empty_1.EMPTY; }
if (falseResult === void 0) { falseResult = empty_1.EMPTY; }
return defer_1.defer(function () { return condition() ? trueResult : falseResult; });
}
exports.iif = iif;
//# sourceMappingURL=iif.js.map

1
node_modules/rxjs/internal/observable/iif.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"iif.js","sources":["../../src/internal/observable/iif.ts"],"names":[],"mappings":";;AACA,iCAAgC;AAChC,iCAAgC;AA2FhC,SAAgB,GAAG,CACjB,SAAwB,EACxB,UAA4C,EAC5C,WAA6C;IAD7C,2BAAA,EAAA,aAAuC,aAAK;IAC5C,4BAAA,EAAA,cAAwC,aAAK;IAE7C,OAAO,aAAK,CAAC,cAAM,OAAA,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,EAAtC,CAAsC,CAAC,CAAC;AAC7D,CAAC;AAND,kBAMC"}

51
node_modules/rxjs/internal/observable/interval.d.ts generated vendored Normal file
View File

@ -0,0 +1,51 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
/**
* Creates an Observable that emits sequential numbers every specified
* interval of time, on a specified {@link SchedulerLike}.
*
* <span class="informal">Emits incremental numbers periodically in time.
* </span>
*
* ![](interval.png)
*
* `interval` returns an Observable that emits an infinite sequence of
* ascending integers, with a constant interval of time of your choosing
* between those emissions. The first emission is not sent immediately, but
* only after the first period has passed. By default, this operator uses the
* `async` {@link SchedulerLike} to provide a notion of time, but you may pass any
* {@link SchedulerLike} to it.
*
* ## Example
* Emits ascending numbers, one every second (1000ms) up to the number 3
* ```ts
* import { interval } from 'rxjs';
* import { take } from 'rxjs/operators';
*
* const numbers = interval(1000);
*
* const takeFourNumbers = numbers.pipe(take(4));
*
* takeFourNumbers.subscribe(x => console.log('Next: ', x));
*
* // Logs:
* // Next: 0
* // Next: 1
* // Next: 2
* // Next: 3
* ```
*
* @see {@link timer}
* @see {@link delay}
*
* @param {number} [period=0] The interval size in milliseconds (by default)
* or the time unit determined by the scheduler's clock.
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling
* the emission of values, and providing a notion of "time".
* @return {Observable} An Observable that emits a sequential number each time
* interval.
* @static true
* @name interval
* @owner Observable
*/
export declare function interval(period?: number, scheduler?: SchedulerLike): Observable<number>;

26
node_modules/rxjs/internal/observable/interval.js generated vendored Normal file
View File

@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var async_1 = require("../scheduler/async");
var isNumeric_1 = require("../util/isNumeric");
function interval(period, scheduler) {
if (period === void 0) { period = 0; }
if (scheduler === void 0) { scheduler = async_1.async; }
if (!isNumeric_1.isNumeric(period) || period < 0) {
period = 0;
}
if (!scheduler || typeof scheduler.schedule !== 'function') {
scheduler = async_1.async;
}
return new Observable_1.Observable(function (subscriber) {
subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
return subscriber;
});
}
exports.interval = interval;
function dispatch(state) {
var subscriber = state.subscriber, counter = state.counter, period = state.period;
subscriber.next(counter);
this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
}
//# sourceMappingURL=interval.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"interval.js","sources":["../../src/internal/observable/interval.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAC3C,4CAA2C;AAE3C,+CAA8C;AAmD9C,SAAgB,QAAQ,CAAC,MAAU,EACV,SAAgC;IADhC,uBAAA,EAAA,UAAU;IACV,0BAAA,EAAA,YAA2B,aAAK;IACvD,IAAI,CAAC,qBAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE;QACpC,MAAM,GAAG,CAAC,CAAC;KACZ;IAED,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,UAAU,EAAE;QAC1D,SAAS,GAAG,aAAK,CAAC;KACnB;IAED,OAAO,IAAI,uBAAU,CAAS,UAAA,UAAU;QACtC,UAAU,CAAC,GAAG,CACZ,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,UAAU,YAAA,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,CACzE,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC;AAhBD,4BAgBC;AAED,SAAS,QAAQ,CAAuC,KAAoB;IAClE,IAAA,6BAAU,EAAE,uBAAO,EAAE,qBAAM,CAAW;IAC9C,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,YAAA,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,EAAE,MAAM,QAAA,EAAE,EAAE,MAAM,CAAC,CAAC;AACtE,CAAC"}

44
node_modules/rxjs/internal/observable/merge.d.ts generated vendored Normal file
View File

@ -0,0 +1,44 @@
import { Observable } from '../Observable';
import { ObservableInput, SchedulerLike } from '../types';
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T>(v1: ObservableInput<T>, scheduler: SchedulerLike): Observable<T>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T>(v1: ObservableInput<T>, concurrent: number, scheduler: SchedulerLike): Observable<T>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, scheduler: SchedulerLike): Observable<T | T2>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler: SchedulerLike): Observable<T | T2 | T3>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;
export declare function merge<T>(v1: ObservableInput<T>): Observable<T>;
export declare function merge<T>(v1: ObservableInput<T>, concurrent?: number): Observable<T>;
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>): Observable<T | T2>;
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, concurrent?: number): Observable<T | T2>;
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<T | T2 | T3>;
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent?: number): Observable<T | T2 | T3>;
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<T | T2 | T3 | T4>;
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent?: number): Observable<T | T2 | T3 | T4>;
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<T | T2 | T3 | T4 | T5>;
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent?: number): Observable<T | T2 | T3 | T4 | T5>;
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<T | T2 | T3 | T4 | T5 | T6>;
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent?: number): Observable<T | T2 | T3 | T4 | T5 | T6>;
export declare function merge<T>(...observables: (ObservableInput<T> | number)[]): Observable<T>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T>(...observables: (ObservableInput<T> | SchedulerLike | number)[]): Observable<T>;
export declare function merge<T, R>(...observables: (ObservableInput<any> | number)[]): Observable<R>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, R>(...observables: (ObservableInput<any> | SchedulerLike | number)[]): Observable<R>;

30
node_modules/rxjs/internal/observable/merge.js generated vendored Normal file
View File

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var isScheduler_1 = require("../util/isScheduler");
var mergeAll_1 = require("../operators/mergeAll");
var fromArray_1 = require("./fromArray");
function merge() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
var concurrent = Number.POSITIVE_INFINITY;
var scheduler = null;
var last = observables[observables.length - 1];
if (isScheduler_1.isScheduler(last)) {
scheduler = observables.pop();
if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
concurrent = observables.pop();
}
}
else if (typeof last === 'number') {
concurrent = observables.pop();
}
if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable_1.Observable) {
return observables[0];
}
return mergeAll_1.mergeAll(concurrent)(fromArray_1.fromArray(observables, scheduler));
}
exports.merge = merge;
//# sourceMappingURL=merge.js.map

1
node_modules/rxjs/internal/observable/merge.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"merge.js","sources":["../../src/internal/observable/merge.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,mDAAkD;AAClD,kDAAiD;AACjD,yCAAwC;AAqHxC,SAAgB,KAAK;IAAO,qBAAoE;SAApE,UAAoE,EAApE,qBAAoE,EAApE,IAAoE;QAApE,gCAAoE;;IAC/F,IAAI,UAAU,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC1C,IAAI,SAAS,GAAkB,IAAI,CAAC;IACnC,IAAI,IAAI,GAAQ,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpD,IAAI,yBAAW,CAAC,IAAI,CAAC,EAAE;QACrB,SAAS,GAAkB,WAAW,CAAC,GAAG,EAAE,CAAC;QAC7C,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,QAAQ,EAAE;YACrF,UAAU,GAAW,WAAW,CAAC,GAAG,EAAE,CAAC;SACxC;KACF;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QACnC,UAAU,GAAW,WAAW,CAAC,GAAG,EAAE,CAAC;KACxC;IAED,IAAI,SAAS,KAAK,IAAI,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,YAAY,uBAAU,EAAE;QAC1F,OAAsB,WAAW,CAAC,CAAC,CAAC,CAAC;KACtC;IAED,OAAO,mBAAQ,CAAI,UAAU,CAAC,CAAC,qBAAS,CAAM,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AACzE,CAAC;AAlBD,sBAkBC"}

36
node_modules/rxjs/internal/observable/never.d.ts generated vendored Normal file
View File

@ -0,0 +1,36 @@
import { Observable } from '../Observable';
/**
* An Observable that emits no items to the Observer and never completes.
*
* ![](never.png)
*
* A simple Observable that emits neither values nor errors nor the completion
* notification. It can be used for testing purposes or for composing with other
* Observables. Please note that by never emitting a complete notification, this
* Observable keeps the subscription from being disposed automatically.
* Subscriptions need to be manually disposed.
*
* ## Example
* ### Emit the number 7, then never emit anything else (not even complete)
* ```ts
* import { NEVER } from 'rxjs';
* import { startWith } from 'rxjs/operators';
*
* function info() {
* console.log('Will not be called');
* }
* const result = NEVER.pipe(startWith(7));
* result.subscribe(x => console.log(x), info, info);
*
* ```
*
* @see {@link Observable}
* @see {@link index/EMPTY}
* @see {@link of}
* @see {@link throwError}
*/
export declare const NEVER: Observable<never>;
/**
* @deprecated Deprecated in favor of using {@link NEVER} constant.
*/
export declare function never(): Observable<never>;

10
node_modules/rxjs/internal/observable/never.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var noop_1 = require("../util/noop");
exports.NEVER = new Observable_1.Observable(noop_1.noop);
function never() {
return exports.NEVER;
}
exports.never = never;
//# sourceMappingURL=never.js.map

1
node_modules/rxjs/internal/observable/never.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"never.js","sources":["../../src/internal/observable/never.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAC3C,qCAAoC;AAgCvB,QAAA,KAAK,GAAG,IAAI,uBAAU,CAAQ,WAAI,CAAC,CAAC;AAKjD,SAAgB,KAAK;IACnB,OAAO,aAAK,CAAC;AACf,CAAC;AAFD,sBAEC"}

31
node_modules/rxjs/internal/observable/of.d.ts generated vendored Normal file
View File

@ -0,0 +1,31 @@
import { SchedulerLike } from '../types';
import { Observable } from '../Observable';
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T>(a: T, scheduler: SchedulerLike): Observable<T>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2>(a: T, b: T2, scheduler: SchedulerLike): Observable<T | T2>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2, T3>(a: T, b: T2, c: T3, scheduler: SchedulerLike): Observable<T | T2 | T3>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2, T3, T4>(a: T, b: T2, c: T3, d: T4, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2, T3, T4, T5>(a: T, b: T2, c: T3, d: T4, e: T5, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2, T3, T4, T5, T6>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2, T3, T4, T5, T6, T7>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6 | T7>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2, T3, T4, T5, T6, T7, T8>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>;
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T, T2, T3, T4, T5, T6, T7, T8, T9>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;
export declare function of<T>(...args: (T | SchedulerLike)[]): Observable<T>;
export declare function of<T>(a: T): Observable<T>;
export declare function of<T, T2>(a: T, b: T2): Observable<T | T2>;
export declare function of<T, T2, T3>(a: T, b: T2, c: T3): Observable<T | T2 | T3>;
export declare function of<T, T2, T3, T4>(a: T, b: T2, c: T3, d: T4): Observable<T | T2 | T3 | T4>;
export declare function of<T, T2, T3, T4, T5>(a: T, b: T2, c: T3, d: T4, e: T5): Observable<T | T2 | T3 | T4 | T5>;
export declare function of<T, T2, T3, T4, T5, T6>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6): Observable<T | T2 | T3 | T4 | T5 | T6>;
export declare function of<T, T2, T3, T4, T5, T6, T7>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7): Observable<T | T2 | T3 | T4 | T5 | T6 | T7>;
export declare function of<T, T2, T3, T4, T5, T6, T7, T8>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>;
export declare function of<T, T2, T3, T4, T5, T6, T7, T8, T9>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;
export declare function of<T>(...args: T[]): Observable<T>;

21
node_modules/rxjs/internal/observable/of.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isScheduler_1 = require("../util/isScheduler");
var fromArray_1 = require("./fromArray");
var scheduleArray_1 = require("../scheduled/scheduleArray");
function of() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var scheduler = args[args.length - 1];
if (isScheduler_1.isScheduler(scheduler)) {
args.pop();
return scheduleArray_1.scheduleArray(args, scheduler);
}
else {
return fromArray_1.fromArray(args);
}
}
exports.of = of;
//# sourceMappingURL=of.js.map

1
node_modules/rxjs/internal/observable/of.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"of.js","sources":["../../src/internal/observable/of.ts"],"names":[],"mappings":";;AACA,mDAAkD;AAClD,yCAAwC;AAExC,4DAA2D;AAiG3D,SAAgB,EAAE;IAAI,cAAiC;SAAjC,UAAiC,EAAjC,qBAAiC,EAAjC,IAAiC;QAAjC,yBAAiC;;IACrD,IAAI,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAkB,CAAC;IACvD,IAAI,yBAAW,CAAC,SAAS,CAAC,EAAE;QAC1B,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,OAAO,6BAAa,CAAC,IAAW,EAAE,SAAS,CAAC,CAAC;KAC9C;SAAM;QACL,OAAO,qBAAS,CAAC,IAAW,CAAC,CAAC;KAC/B;AACH,CAAC;AARD,gBAQC"}

View File

@ -0,0 +1,9 @@
import { Observable } from '../Observable';
import { ObservableInput } from '../types';
export declare function onErrorResumeNext<R>(v: ObservableInput<R>): Observable<R>;
export declare function onErrorResumeNext<T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<R>;
export declare function onErrorResumeNext<T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<R>;
export declare function onErrorResumeNext<T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<R>;
export declare function onErrorResumeNext<T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<R>;
export declare function onErrorResumeNext<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;
export declare function onErrorResumeNext<R>(array: ObservableInput<any>[]): Observable<R>;

View File

@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var from_1 = require("./from");
var isArray_1 = require("../util/isArray");
var empty_1 = require("./empty");
function onErrorResumeNext() {
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
if (sources.length === 0) {
return empty_1.EMPTY;
}
var first = sources[0], remainder = sources.slice(1);
if (sources.length === 1 && isArray_1.isArray(first)) {
return onErrorResumeNext.apply(void 0, first);
}
return new Observable_1.Observable(function (subscriber) {
var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); };
return from_1.from(first).subscribe({
next: function (value) { subscriber.next(value); },
error: subNext,
complete: subNext,
});
});
}
exports.onErrorResumeNext = onErrorResumeNext;
//# sourceMappingURL=onErrorResumeNext.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"onErrorResumeNext.js","sources":["../../src/internal/observable/onErrorResumeNext.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAE3C,+BAA8B;AAC9B,2CAA0C;AAC1C,iCAAgC;AAwEhC,SAAgB,iBAAiB;IAAO,iBAEqD;SAFrD,UAEqD,EAFrD,qBAEqD,EAFrD,IAEqD;QAFrD,4BAEqD;;IAE3F,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,aAAK,CAAC;KACd;IAEO,IAAA,kBAAK,EAAE,4BAAY,CAAa;IAExC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,iBAAO,CAAC,KAAK,CAAC,EAAE;QAC1C,OAAO,iBAAiB,eAAI,KAAK,EAAE;KACpC;IAED,OAAO,IAAI,uBAAU,CAAC,UAAA,UAAU;QAC9B,IAAM,OAAO,GAAG,cAAM,OAAA,UAAU,CAAC,GAAG,CAClC,iBAAiB,eAAI,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,CACtD,EAFqB,CAErB,CAAC;QAEF,OAAO,WAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;YAC3B,IAAI,YAAC,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvC,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAzBD,8CAyBC"}

61
node_modules/rxjs/internal/observable/pairs.d.ts generated vendored Normal file
View File

@ -0,0 +1,61 @@
import { Observable } from '../Observable';
import { SchedulerAction, SchedulerLike } from '../types';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
/**
* Convert an object into an Observable of `[key, value]` pairs.
*
* <span class="informal">Turn entries of an object into a stream.</span>
*
* <img src="./img/pairs.png" width="100%">
*
* `pairs` takes an arbitrary object and returns an Observable that emits arrays. Each
* emitted array has exactly two elements - the first is a key from the object
* and the second is a value corresponding to that key. Keys are extracted from
* an object via `Object.keys` function, which means that they will be only
* enumerable keys that are present on an object directly - not ones inherited
* via prototype chain.
*
* By default these arrays are emitted synchronously. To change that you can
* pass a {@link SchedulerLike} as a second argument to `pairs`.
*
* @example <caption>Converts a javascript object to an Observable</caption>
* ```ts
* import { pairs } from 'rxjs';
*
* const obj = {
* foo: 42,
* bar: 56,
* baz: 78
* };
*
* pairs(obj)
* .subscribe(
* value => console.log(value),
* err => {},
* () => console.log('the end!')
* );
*
* // Logs:
* // ["foo", 42],
* // ["bar", 56],
* // ["baz", 78],
* // "the end!"
* ```
*
* @param {Object} obj The object to inspect and turn into an
* Observable sequence.
* @param {Scheduler} [scheduler] An optional IScheduler to schedule
* when resulting Observable will emit values.
* @returns {(Observable<Array<string|T>>)} An observable sequence of
* [key, value] pairs from the object.
*/
export declare function pairs<T>(obj: Object, scheduler?: SchedulerLike): Observable<[string, T]>;
/** @internal */
export declare function dispatch<T>(this: SchedulerAction<any>, state: {
keys: string[];
index: number;
subscriber: Subscriber<[string, T]>;
subscription: Subscription;
obj: Object;
}): void;

42
node_modules/rxjs/internal/observable/pairs.js generated vendored Normal file
View File

@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var Subscription_1 = require("../Subscription");
function pairs(obj, scheduler) {
if (!scheduler) {
return new Observable_1.Observable(function (subscriber) {
var keys = Object.keys(obj);
for (var i = 0; i < keys.length && !subscriber.closed; i++) {
var key = keys[i];
if (obj.hasOwnProperty(key)) {
subscriber.next([key, obj[key]]);
}
}
subscriber.complete();
});
}
else {
return new Observable_1.Observable(function (subscriber) {
var keys = Object.keys(obj);
var subscription = new Subscription_1.Subscription();
subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
return subscription;
});
}
}
exports.pairs = pairs;
function dispatch(state) {
var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
if (!subscriber.closed) {
if (index < keys.length) {
var key = keys[index];
subscriber.next([key, obj[key]]);
subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
}
else {
subscriber.complete();
}
}
}
exports.dispatch = dispatch;
//# sourceMappingURL=pairs.js.map

1
node_modules/rxjs/internal/observable/pairs.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"pairs.js","sources":["../../src/internal/observable/pairs.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAG3C,gDAA+C;AAkD/C,SAAgB,KAAK,CAAI,GAAW,EAAE,SAAyB;IAC7D,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,IAAI,uBAAU,CAAc,UAAA,UAAU;YAC3C,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC1D,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBAC3B,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;iBAClC;aACF;YACD,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,OAAO,IAAI,uBAAU,CAAc,UAAA,UAAU;YAC3C,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAM,YAAY,GAAG,IAAI,2BAAY,EAAE,CAAC;YACxC,YAAY,CAAC,GAAG,CACd,SAAS,CAAC,QAAQ,CACf,QAAQ,EAAE,CAAC,EAAE,EAAE,IAAI,MAAA,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,YAAA,EAAE,YAAY,cAAA,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC,CAAC;YACtE,OAAO,YAAY,CAAC;QACtB,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAtBD,sBAsBC;AAGD,SAAgB,QAAQ,CACI,KAAsH;IACxI,IAAA,iBAAI,EAAE,mBAAK,EAAE,6BAAU,EAAE,iCAAY,EAAE,eAAG,CAAW;IAC7D,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;QACtB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE;YACvB,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YACxB,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,MAAA,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,UAAU,YAAA,EAAE,YAAY,cAAA,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC,CAAC;SAC5F;aAAM;YACL,UAAU,CAAC,QAAQ,EAAE,CAAC;SACvB;KACF;AACH,CAAC;AAZD,4BAYC"}

54
node_modules/rxjs/internal/observable/partition.d.ts generated vendored Normal file
View File

@ -0,0 +1,54 @@
import { ObservableInput } from '../types';
import { Observable } from '../Observable';
/**
* Splits the source Observable into two, one with values that satisfy a
* predicate, and another with values that don't satisfy the predicate.
*
* <span class="informal">It's like {@link filter}, but returns two Observables:
* one like the output of {@link filter}, and the other with values that did not
* pass the condition.</span>
*
* ![](partition.png)
*
* `partition` outputs an array with two Observables that partition the values
* from the source Observable through the given `predicate` function. The first
* Observable in that array emits source values for which the predicate argument
* returns true. The second Observable emits source values for which the
* predicate returns false. The first behaves like {@link filter} and the second
* behaves like {@link filter} with the predicate negated.
*
* ## Example
* Partition a set of numbers into odds and evens observables
* ```ts
* import { of, partition } from 'rxjs';
*
* const observableValues = of(1, 2, 3, 4, 5, 6);
* const [evens$, odds$] = partition(observableValues, (value, index) => value % 2 === 0);
*
* odds$.subscribe(x => console.log('odds', x));
* evens$.subscribe(x => console.log('evens', x));
*
* // Logs:
* // odds 1
* // odds 3
* // odds 5
* // evens 2
* // evens 4
* // evens 6
* ```
*
* @see {@link filter}
*
* @param {function(value: T, index: number): boolean} predicate A function that
* evaluates each value emitted by the source Observable. If it returns `true`,
* the value is emitted on the first Observable in the returned array, if
* `false` the value is emitted on the second Observable in the array. The
* `index` parameter is the number `i` for the i-th source emission that has
* happened since the subscription, starting from the number `0`.
* @param {any} [thisArg] An optional argument to determine the value of `this`
* in the `predicate` function.
* @return {[Observable<T>, Observable<T>]} An array with two Observables: one
* with values that passed the predicate, and another with values that did not
* pass the predicate.
*/
export declare function partition<T>(source: ObservableInput<T>, predicate: (value: T, index: number) => boolean, thisArg?: any): [Observable<T>, Observable<T>];

14
node_modules/rxjs/internal/observable/partition.js generated vendored Normal file
View File

@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var not_1 = require("../util/not");
var subscribeTo_1 = require("../util/subscribeTo");
var filter_1 = require("../operators/filter");
var Observable_1 = require("../Observable");
function partition(source, predicate, thisArg) {
return [
filter_1.filter(predicate, thisArg)(new Observable_1.Observable(subscribeTo_1.subscribeTo(source))),
filter_1.filter(not_1.not(predicate, thisArg))(new Observable_1.Observable(subscribeTo_1.subscribeTo(source)))
];
}
exports.partition = partition;
//# sourceMappingURL=partition.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"partition.js","sources":["../../src/internal/observable/partition.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AAClC,mDAAkD;AAClD,8CAA6C;AAE7C,4CAA2C;AAqD3C,SAAgB,SAAS,CACvB,MAA0B,EAC1B,SAA+C,EAC/C,OAAa;IAEb,OAAO;QACL,eAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,uBAAU,CAAI,yBAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QAClE,eAAM,CAAC,SAAG,CAAC,SAAS,EAAE,OAAO,CAAQ,CAAC,CAAC,IAAI,uBAAU,CAAI,yBAAW,CAAC,MAAM,CAAC,CAAC,CAAC;KAC7C,CAAC;AACtC,CAAC;AATD,8BASC"}

38
node_modules/rxjs/internal/observable/race.d.ts generated vendored Normal file
View File

@ -0,0 +1,38 @@
import { Observable } from '../Observable';
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { TeardownLogic, ObservableInput } from '../types';
import { OuterSubscriber } from '../OuterSubscriber';
export declare function race<A>(arg: [ObservableInput<A>]): Observable<A>;
export declare function race<A, B>(arg: [ObservableInput<A>, ObservableInput<B>]): Observable<A | B>;
export declare function race<A, B, C>(arg: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>]): Observable<A | B | C>;
export declare function race<A, B, C, D>(arg: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>]): Observable<A | B | C | D>;
export declare function race<A, B, C, D, E>(arg: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>, ObservableInput<E>]): Observable<A | B | C | D | E>;
export declare function race<T>(arg: ObservableInput<T>[]): Observable<T>;
export declare function race(arg: ObservableInput<any>[]): Observable<{}>;
export declare function race<A>(a: ObservableInput<A>): Observable<A>;
export declare function race<A, B>(a: ObservableInput<A>, b: ObservableInput<B>): Observable<A | B>;
export declare function race<A, B, C>(a: ObservableInput<A>, b: ObservableInput<B>, c: ObservableInput<C>): Observable<A | B | C>;
export declare function race<A, B, C, D>(a: ObservableInput<A>, b: ObservableInput<B>, c: ObservableInput<C>, d: ObservableInput<D>): Observable<A | B | C | D>;
export declare function race<A, B, C, D, E>(a: ObservableInput<A>, b: ObservableInput<B>, c: ObservableInput<C>, d: ObservableInput<D>, e: ObservableInput<E>): Observable<A | B | C | D | E>;
export declare function race<T>(observables: ObservableInput<T>[]): Observable<T>;
export declare function race(observables: ObservableInput<any>[]): Observable<{}>;
export declare function race<T>(...observables: ObservableInput<T>[]): Observable<T>;
export declare function race(...observables: ObservableInput<any>[]): Observable<{}>;
export declare class RaceOperator<T> implements Operator<T, T> {
call(subscriber: Subscriber<T>, source: any): TeardownLogic;
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
export declare class RaceSubscriber<T> extends OuterSubscriber<T, T> {
private hasFirst;
private observables;
private subscriptions;
constructor(destination: Subscriber<T>);
protected _next(observable: any): void;
protected _complete(): void;
notifyNext(_outerValue: T, innerValue: T, outerIndex: number): void;
}

92
node_modules/rxjs/internal/observable/race.js generated vendored Normal file
View File

@ -0,0 +1,92 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var isArray_1 = require("../util/isArray");
var fromArray_1 = require("./fromArray");
var OuterSubscriber_1 = require("../OuterSubscriber");
var subscribeToResult_1 = require("../util/subscribeToResult");
function race() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
if (observables.length === 1) {
if (isArray_1.isArray(observables[0])) {
observables = observables[0];
}
else {
return observables[0];
}
}
return fromArray_1.fromArray(observables, undefined).lift(new RaceOperator());
}
exports.race = race;
var RaceOperator = (function () {
function RaceOperator() {
}
RaceOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new RaceSubscriber(subscriber));
};
return RaceOperator;
}());
exports.RaceOperator = RaceOperator;
var RaceSubscriber = (function (_super) {
__extends(RaceSubscriber, _super);
function RaceSubscriber(destination) {
var _this = _super.call(this, destination) || this;
_this.hasFirst = false;
_this.observables = [];
_this.subscriptions = [];
return _this;
}
RaceSubscriber.prototype._next = function (observable) {
this.observables.push(observable);
};
RaceSubscriber.prototype._complete = function () {
var observables = this.observables;
var len = observables.length;
if (len === 0) {
this.destination.complete();
}
else {
for (var i = 0; i < len && !this.hasFirst; i++) {
var observable = observables[i];
var subscription = subscribeToResult_1.subscribeToResult(this, observable, undefined, i);
if (this.subscriptions) {
this.subscriptions.push(subscription);
}
this.add(subscription);
}
this.observables = null;
}
};
RaceSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {
if (!this.hasFirst) {
this.hasFirst = true;
for (var i = 0; i < this.subscriptions.length; i++) {
if (i !== outerIndex) {
var subscription = this.subscriptions[i];
subscription.unsubscribe();
this.remove(subscription);
}
}
this.subscriptions = null;
}
this.destination.next(innerValue);
};
return RaceSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.RaceSubscriber = RaceSubscriber;
//# sourceMappingURL=race.js.map

1
node_modules/rxjs/internal/observable/race.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"race.js","sources":["../../src/internal/observable/race.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAA0C;AAC1C,yCAAwC;AAKxC,sDAAqD;AAErD,+DAA8D;AAoD9D,SAAgB,IAAI;IAAI,qBAAsC;SAAtC,UAAsC,EAAtC,qBAAsC,EAAtC,IAAsC;QAAtC,gCAAsC;;IAG5D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5B,IAAI,iBAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;YAC3B,WAAW,GAAG,WAAW,CA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ACtB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;iBACvC;gBACD,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;aACxB;YACD,IAAI,CAAC,WAAW,GAAG,IAAK,CAAC;SAC1B;IACH,CAAC;IAED,mCAAU,GAAV,UAAW,WAAc,EAAE,UAAa,EAC7B,UAAkB;QAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAClD,IAAI,CAAC,KAAK,UAAU,EAAE;oBACpB,IAAI,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;oBAEzC,YAAY,CAAC,WAAW,EAAE,CAAC;oBAC3B,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;iBAC3B;aACF;YAED,IAAI,CAAC,aAAa,GAAG,IAAK,CAAC;SAC5B;QAED,IAAI,CAAC,WAAW,CAAC,IAAK,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IACH,qBAAC;AAAD,CAAC,AApDD,CAAuC,iCAAe,GAoDrD;AApDY,wCAAc"}

39
node_modules/rxjs/internal/observable/range.d.ts generated vendored Normal file
View File

@ -0,0 +1,39 @@
import { SchedulerAction, SchedulerLike } from '../types';
import { Observable } from '../Observable';
/**
* Creates an Observable that emits a sequence of numbers within a specified
* range.
*
* <span class="informal">Emits a sequence of numbers in a range.</span>
*
* ![](range.png)
*
* `range` operator emits a range of sequential integers, in order, where you
* select the `start` of the range and its `length`. By default, uses no
* {@link SchedulerLike} and just delivers the notifications synchronously, but may use
* an optional {@link SchedulerLike} to regulate those deliveries.
*
* ## Example
* Emits the numbers 1 to 10</caption>
* ```ts
* import { range } from 'rxjs';
*
* const numbers = range(1, 10);
* numbers.subscribe(x => console.log(x));
* ```
* @see {@link timer}
* @see {@link index/interval}
*
* @param {number} [start=0] The value of the first integer in the sequence.
* @param {number} count The number of sequential integers to generate.
* @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling
* the emissions of the notifications.
* @return {Observable} An Observable of numbers that emits a finite range of
* sequential integers.
* @static true
* @name range
* @owner Observable
*/
export declare function range(start?: number, count?: number, scheduler?: SchedulerLike): Observable<number>;
/** @internal */
export declare function dispatch(this: SchedulerAction<any>, state: any): void;

49
node_modules/rxjs/internal/observable/range.js generated vendored Normal file
View File

@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
function range(start, count, scheduler) {
if (start === void 0) { start = 0; }
return new Observable_1.Observable(function (subscriber) {
if (count === undefined) {
count = start;
start = 0;
}
var index = 0;
var current = start;
if (scheduler) {
return scheduler.schedule(dispatch, 0, {
index: index, count: count, start: start, subscriber: subscriber
});
}
else {
do {
if (index++ >= count) {
subscriber.complete();
break;
}
subscriber.next(current++);
if (subscriber.closed) {
break;
}
} while (true);
}
return undefined;
});
}
exports.range = range;
function dispatch(state) {
var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
if (index >= count) {
subscriber.complete();
return;
}
subscriber.next(start);
if (subscriber.closed) {
return;
}
state.index = index + 1;
state.start = start + 1;
this.schedule(state);
}
exports.dispatch = dispatch;
//# sourceMappingURL=range.js.map

1
node_modules/rxjs/internal/observable/range.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"range.js","sources":["../../src/internal/observable/range.ts"],"names":[],"mappings":";;AACA,4CAA2C;AAoC3C,SAAgB,KAAK,CAAC,KAAiB,EACjB,KAAc,EACd,SAAyB;IAFzB,sBAAA,EAAA,SAAiB;IAGrC,OAAO,IAAI,uBAAU,CAAS,UAAA,UAAU;QACtC,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,KAAK,GAAG,KAAK,CAAC;YACd,KAAK,GAAG,CAAC,CAAC;SACX;QAED,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,IAAI,SAAS,EAAE;YACb,OAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE;gBACrC,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,UAAU,YAAA;aAChC,CAAC,CAAC;SACJ;aAAM;YACL,GAAG;gBACD,IAAI,KAAK,EAAE,IAAI,KAAK,EAAE;oBACpB,UAAU,CAAC,QAAQ,EAAE,CAAC;oBACtB,MAAM;iBACP;gBACD,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC3B,IAAI,UAAU,CAAC,MAAM,EAAE;oBACrB,MAAM;iBACP;aACF,QAAQ,IAAI,EAAE;SAChB;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AA/BD,sBA+BC;AAGD,SAAgB,QAAQ,CAA6B,KAAU;IACrD,IAAA,mBAAK,EAAE,mBAAK,EAAE,mBAAK,EAAE,6BAAU,CAAW;IAElD,IAAI,KAAK,IAAI,KAAK,EAAE;QAClB,UAAU,CAAC,QAAQ,EAAE,CAAC;QACtB,OAAO;KACR;IAED,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEvB,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,OAAO;KACR;IAED,KAAK,CAAC,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;IACxB,KAAK,CAAC,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;IAExB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAlBD,4BAkBC"}

67
node_modules/rxjs/internal/observable/throwError.d.ts generated vendored Normal file
View File

@ -0,0 +1,67 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
/**
* Creates an Observable that emits no items to the Observer and immediately
* emits an error notification.
*
* <span class="informal">Just emits 'error', and nothing else.
* </span>
*
* ![](throw.png)
*
* This static operator is useful for creating a simple Observable that only
* emits the error notification. It can be used for composing with other
* Observables, such as in a {@link mergeMap}.
*
* ## Examples
* ### Emit the number 7, then emit an error
* ```ts
* import { throwError, concat, of } from 'rxjs';
*
* const result = concat(of(7), throwError(new Error('oops!')));
* result.subscribe(x => console.log(x), e => console.error(e));
*
* // Logs:
* // 7
* // Error: oops!
* ```
*
* ---
*
* ### Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 2
* ```ts
* import { throwError, interval, of } from 'rxjs';
* import { mergeMap } from 'rxjs/operators';
*
* interval(1000).pipe(
* mergeMap(x => x === 2
* ? throwError('Twos are bad')
* : of('a', 'b', 'c')
* ),
* ).subscribe(x => console.log(x), e => console.error(e));
*
* // Logs:
* // a
* // b
* // c
* // a
* // b
* // c
* // Twos are bad
* ```
*
* @see {@link Observable}
* @see {@link empty}
* @see {@link never}
* @see {@link of}
*
* @param {any} error The particular Error to pass to the error notification.
* @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling
* the emission of the error notification.
* @return {Observable} An error Observable: emits only the error notification
* using the given error argument.
* @static true
* @name throwError
* @owner Observable
*/
export declare function throwError(error: any, scheduler?: SchedulerLike): Observable<never>;

17
node_modules/rxjs/internal/observable/throwError.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
function throwError(error, scheduler) {
if (!scheduler) {
return new Observable_1.Observable(function (subscriber) { return subscriber.error(error); });
}
else {
return new Observable_1.Observable(function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });
}
}
exports.throwError = throwError;
function dispatch(_a) {
var error = _a.error, subscriber = _a.subscriber;
subscriber.error(error);
}
//# sourceMappingURL=throwError.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"throwError.js","sources":["../../src/internal/observable/throwError.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAoE3C,SAAgB,UAAU,CAAC,KAAU,EAAE,SAAyB;IAC9D,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,IAAI,uBAAU,CAAC,UAAA,UAAU,IAAI,OAAA,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EAAvB,CAAuB,CAAC,CAAC;KAC9D;SAAM;QACL,OAAO,IAAI,uBAAU,CAAC,UAAA,UAAU,IAAI,OAAA,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,KAAK,OAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAtD,CAAsD,CAAC,CAAC;KAC7F;AACH,CAAC;AAND,gCAMC;AAOD,SAAS,QAAQ,CAAC,EAAkC;QAAhC,gBAAK,EAAE,0BAAU;IACnC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}

53
node_modules/rxjs/internal/observable/timer.d.ts generated vendored Normal file
View File

@ -0,0 +1,53 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
/**
* Creates an Observable that starts emitting after an `dueTime` and
* emits ever increasing numbers after each `period` of time thereafter.
*
* <span class="informal">Its like {@link index/interval}, but you can specify when
* should the emissions start.</span>
*
* ![](timer.png)
*
* `timer` returns an Observable that emits an infinite sequence of ascending
* integers, with a constant interval of time, `period` of your choosing
* between those emissions. The first emission happens after the specified
* `dueTime`. The initial delay may be a `Date`. By default, this
* operator uses the {@link asyncScheduler} {@link SchedulerLike} to provide a notion of time, but you
* may pass any {@link SchedulerLike} to it. If `period` is not specified, the output
* Observable emits only one value, `0`. Otherwise, it emits an infinite
* sequence.
*
* ## Examples
* ### Emits ascending numbers, one every second (1000ms), starting after 3 seconds
* ```ts
* import { timer } from 'rxjs';
*
* const numbers = timer(3000, 1000);
* numbers.subscribe(x => console.log(x));
* ```
*
* ### Emits one number after five seconds
* ```ts
* import { timer } from 'rxjs';
*
* const numbers = timer(5000);
* numbers.subscribe(x => console.log(x));
* ```
* @see {@link index/interval}
* @see {@link delay}
*
* @param {number|Date} [dueTime] The initial delay time specified as a Date object or as an integer denoting
* milliseconds to wait before emitting the first value of 0`.
* @param {number|SchedulerLike} [periodOrScheduler] The period of time between emissions of the
* subsequent numbers.
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling
* the emission of values, and providing a notion of "time".
* @return {Observable} An Observable that emits a `0` after the
* `dueTime` and ever increasing numbers after each `period` of time
* thereafter.
* @static true
* @name timer
* @owner Observable
*/
export declare function timer(dueTime?: number | Date, periodOrScheduler?: number | SchedulerLike, scheduler?: SchedulerLike): Observable<number>;

41
node_modules/rxjs/internal/observable/timer.js generated vendored Normal file
View File

@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../Observable");
var async_1 = require("../scheduler/async");
var isNumeric_1 = require("../util/isNumeric");
var isScheduler_1 = require("../util/isScheduler");
function timer(dueTime, periodOrScheduler, scheduler) {
if (dueTime === void 0) { dueTime = 0; }
var period = -1;
if (isNumeric_1.isNumeric(periodOrScheduler)) {
period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
}
else if (isScheduler_1.isScheduler(periodOrScheduler)) {
scheduler = periodOrScheduler;
}
if (!isScheduler_1.isScheduler(scheduler)) {
scheduler = async_1.async;
}
return new Observable_1.Observable(function (subscriber) {
var due = isNumeric_1.isNumeric(dueTime)
? dueTime
: (+dueTime - scheduler.now());
return scheduler.schedule(dispatch, due, {
index: 0, period: period, subscriber: subscriber
});
});
}
exports.timer = timer;
function dispatch(state) {
var index = state.index, period = state.period, subscriber = state.subscriber;
subscriber.next(index);
if (subscriber.closed) {
return;
}
else if (period === -1) {
return subscriber.complete();
}
state.index = index + 1;
this.schedule(state, period);
}
//# sourceMappingURL=timer.js.map

1
node_modules/rxjs/internal/observable/timer.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"timer.js","sources":["../../src/internal/observable/timer.ts"],"names":[],"mappings":";;AAAA,4C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CAAC,CAAC;IACxB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC"}

31
node_modules/rxjs/internal/observable/using.d.ts generated vendored Normal file
View File

@ -0,0 +1,31 @@
import { Observable } from '../Observable';
import { Unsubscribable, ObservableInput } from '../types';
/**
* Creates an Observable that uses a resource which will be disposed at the same time as the Observable.
*
* <span class="informal">Use it when you catch yourself cleaning up after an Observable.</span>
*
* `using` is a factory operator, which accepts two functions. First function returns a disposable resource.
* It can be an arbitrary object that implements `unsubscribe` method. Second function will be injected with
* that object and should return an Observable. That Observable can use resource object during its execution.
* Both functions passed to `using` will be called every time someone subscribes - neither an Observable nor
* resource object will be shared in any way between subscriptions.
*
* When Observable returned by `using` is subscribed, Observable returned from the second function will be subscribed
* as well. All its notifications (nexted values, completion and error events) will be emitted unchanged by the output
* Observable. If however someone unsubscribes from the Observable or source Observable completes or errors by itself,
* the `unsubscribe` method on resource object will be called. This can be used to do any necessary clean up, which
* otherwise would have to be handled by hand. Note that complete or error notifications are not emitted when someone
* cancels subscription to an Observable via `unsubscribe`, so `using` can be used as a hook, allowing you to make
* sure that all resources which need to exist during an Observable execution will be disposed at appropriate time.
*
* @see {@link defer}
*
* @param {function(): ISubscription} resourceFactory A function which creates any resource object
* that implements `unsubscribe` method.
* @param {function(resource: ISubscription): Observable<T>} observableFactory A function which
* creates an Observable, that can use injected resource object.
* @return {Observable<T>} An Observable that behaves the same as Observable returned by `observableFactory`, but
* which - when completed, errored or unsubscribed - will also call `unsubscribe` on created resource object.
*/
export declare function using<T>(resourceFactory: () => Unsubscribable | void, observableFactory: (resource: Unsubscribable | void) => ObservableInput<T> | void): Observable<T>;

Some files were not shown because too many files have changed in this diff Show More