mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-09-14 11:39:05 +00:00
update
This commit is contained in:
45
node_modules/rxjs/src/AsyncSubject.ts
generated
vendored
Normal file
45
node_modules/rxjs/src/AsyncSubject.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import { Subject } from './Subject';
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { Subscription } from './Subscription';
|
||||
|
||||
/**
|
||||
* @class AsyncSubject<T>
|
||||
*/
|
||||
export class AsyncSubject<T> extends Subject<T> {
|
||||
private value: T = null;
|
||||
private hasNext: boolean = false;
|
||||
private hasCompleted: boolean = false;
|
||||
|
||||
/** @deprecated internal use only */ _subscribe(subscriber: Subscriber<any>): Subscription {
|
||||
if (this.hasError) {
|
||||
subscriber.error(this.thrownError);
|
||||
return Subscription.EMPTY;
|
||||
} else if (this.hasCompleted && this.hasNext) {
|
||||
subscriber.next(this.value);
|
||||
subscriber.complete();
|
||||
return Subscription.EMPTY;
|
||||
}
|
||||
return super._subscribe(subscriber);
|
||||
}
|
||||
|
||||
next(value: T): void {
|
||||
if (!this.hasCompleted) {
|
||||
this.value = value;
|
||||
this.hasNext = true;
|
||||
}
|
||||
}
|
||||
|
||||
error(error: any): void {
|
||||
if (!this.hasCompleted) {
|
||||
super.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
complete(): void {
|
||||
this.hasCompleted = true;
|
||||
if (this.hasNext) {
|
||||
super.next(this.value);
|
||||
}
|
||||
super.complete();
|
||||
}
|
||||
}
|
18
node_modules/rxjs/src/BUILD.bazel
generated
vendored
Normal file
18
node_modules/rxjs/src/BUILD.bazel
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
exports_files(["tsconfig.json"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "rxjs",
|
||||
module_name = "rxjs",
|
||||
srcs = glob(["*.ts", "**/*.ts"]),
|
||||
tsconfig = "tsconfig.json",
|
||||
# Specify the compile-time dependencies to run the compilation (eg. typescript)
|
||||
# The default value assumes that the end-user has a target //:node_modules
|
||||
# but not all users do.
|
||||
# This also makes the build more reproducible, in case the user's TypeScript
|
||||
# version isn't compatible.
|
||||
node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
|
||||
)
|
40
node_modules/rxjs/src/BehaviorSubject.ts
generated
vendored
Normal file
40
node_modules/rxjs/src/BehaviorSubject.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Subject } from './Subject';
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { Subscription, ISubscription } from './Subscription';
|
||||
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
|
||||
|
||||
/**
|
||||
* @class BehaviorSubject<T>
|
||||
*/
|
||||
export class BehaviorSubject<T> extends Subject<T> {
|
||||
|
||||
constructor(private _value: T) {
|
||||
super();
|
||||
}
|
||||
|
||||
get value(): T {
|
||||
return this.getValue();
|
||||
}
|
||||
|
||||
/** @deprecated internal use only */ _subscribe(subscriber: Subscriber<T>): Subscription {
|
||||
const subscription = super._subscribe(subscriber);
|
||||
if (subscription && !(<ISubscription>subscription).closed) {
|
||||
subscriber.next(this._value);
|
||||
}
|
||||
return subscription;
|
||||
}
|
||||
|
||||
getValue(): T {
|
||||
if (this.hasError) {
|
||||
throw this.thrownError;
|
||||
} else if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
} else {
|
||||
return this._value;
|
||||
}
|
||||
}
|
||||
|
||||
next(value: T): void {
|
||||
super.next(this._value = value);
|
||||
}
|
||||
}
|
29
node_modules/rxjs/src/InnerSubscriber.ts
generated
vendored
Normal file
29
node_modules/rxjs/src/InnerSubscriber.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { OuterSubscriber } from './OuterSubscriber';
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
export class InnerSubscriber<T, R> extends Subscriber<R> {
|
||||
private index: number = 0;
|
||||
|
||||
constructor(private parent: OuterSubscriber<T, R>, private outerValue: T, private outerIndex: number) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected _next(value: R): void {
|
||||
this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
|
||||
}
|
||||
|
||||
protected _error(error: any): void {
|
||||
this.parent.notifyError(error, this);
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
||||
protected _complete(): void {
|
||||
this.parent.notifyComplete(this);
|
||||
this.unsubscribe();
|
||||
}
|
||||
}
|
202
node_modules/rxjs/src/LICENSE.txt
generated
vendored
Normal file
202
node_modules/rxjs/src/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (c) 2015-2017 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
451
node_modules/rxjs/src/MiscJSDoc.ts
generated
vendored
Normal file
451
node_modules/rxjs/src/MiscJSDoc.ts
generated
vendored
Normal file
@@ -0,0 +1,451 @@
|
||||
/*
|
||||
* This file and its definitions are needed just so that ESDoc sees these
|
||||
* JSDoc documentation comments. Originally they were meant for some TypeScript
|
||||
* interfaces, but TypeScript strips away JSDoc comments near interfaces. Hence,
|
||||
* we need these bogus classes, which are not stripped away. This file on the
|
||||
* other hand, is not included in the release bundle.
|
||||
*/
|
||||
import { TeardownLogic } from './Subscription';
|
||||
import { Observable } from './Observable';
|
||||
import './observable/dom/MiscJSDoc';
|
||||
import { Observer } from './Observer';
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @extends {Ignored}
|
||||
* @hide true
|
||||
*/
|
||||
export class ObservableDoc {
|
||||
/**
|
||||
* Creates a new Observable, that will execute the specified function when an
|
||||
* {@link Observer} subscribes to it.
|
||||
*
|
||||
* <span class="informal">Create custom Observable, that does whatever you like.</span>
|
||||
*
|
||||
* <img src="./img/create.png" width="100%">
|
||||
*
|
||||
* `create` converts an `onSubscription` function to an actual Observable.
|
||||
* Whenever someone subscribes to that Observable, the function will be called
|
||||
* with an {@link Observer} instance as a first and only parameter. `onSubscription` should
|
||||
* then invoke the Observers `next`, `error` and `complete` methods.
|
||||
*
|
||||
* Calling `next` with a value will emit that value to the observer. Calling `complete`
|
||||
* means that Observable finished emitting and will not do anything else.
|
||||
* Calling `error` means that something went wrong - value passed to `error` method should
|
||||
* provide details on what exactly happened.
|
||||
*
|
||||
* A well-formed Observable can emit as many values as it needs via `next` method,
|
||||
* but `complete` and `error` methods can be called only once and nothing else can be called
|
||||
* thereafter. If you try to invoke `next`, `complete` or `error` methods after created
|
||||
* Observable already completed or ended with an error, these calls will be ignored to
|
||||
* preserve so called *Observable Contract*. Note that you are not required to call
|
||||
* `complete` at any point - it is perfectly fine to create an Observable that never ends,
|
||||
* depending on your needs.
|
||||
*
|
||||
* `onSubscription` can optionally return either a function or an object with
|
||||
* `unsubscribe` method. In both cases function or method will be called when
|
||||
* subscription to Observable is being cancelled and should be used to clean up all
|
||||
* resources. So, for example, if you are using `setTimeout` in your custom
|
||||
* Observable, when someone unsubscribes, you can clear planned timeout, so that
|
||||
* it does not fire needlessly and browser (or other environment) does not waste
|
||||
* computing power on timing event that no one will listen to anyways.
|
||||
*
|
||||
* Most of the times you should not need to use `create`, because existing
|
||||
* operators allow you to create an Observable for most of the use cases.
|
||||
* That being said, `create` is low-level mechanism allowing you to create
|
||||
* any Observable, if you have very specific needs.
|
||||
*
|
||||
* **TypeScript signature issue**
|
||||
*
|
||||
* Because Observable extends class which already has defined static `create` function,
|
||||
* but with different type signature, it was impossible to assign proper signature to
|
||||
* `Observable.create`. Because of that, it has very general type `Function` and thus
|
||||
* function passed to `create` will not be type checked, unless you explicitly state
|
||||
* what signature it should have.
|
||||
*
|
||||
* When using TypeScript we recommend to declare type signature of function passed to
|
||||
* `create` as `(observer: Observer) => TeardownLogic`, where {@link Observer}
|
||||
* and {@link TeardownLogic} are interfaces provided by the library.
|
||||
*
|
||||
* @example <caption>Emit three numbers, then complete.</caption>
|
||||
* var observable = Rx.Observable.create(function (observer) {
|
||||
* observer.next(1);
|
||||
* observer.next(2);
|
||||
* observer.next(3);
|
||||
* observer.complete();
|
||||
* });
|
||||
* observable.subscribe(
|
||||
* value => console.log(value),
|
||||
* err => {},
|
||||
* () => console.log('this is the end')
|
||||
* );
|
||||
*
|
||||
* // Logs
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // "this is the end"
|
||||
*
|
||||
*
|
||||
* @example <caption>Emit an error</caption>
|
||||
* const observable = Rx.Observable.create((observer) => {
|
||||
* observer.error('something went really wrong...');
|
||||
* });
|
||||
*
|
||||
* observable.subscribe(
|
||||
* value => console.log(value), // will never be called
|
||||
* err => console.log(err),
|
||||
* () => console.log('complete') // will never be called
|
||||
* );
|
||||
*
|
||||
* // Logs
|
||||
* // "something went really wrong..."
|
||||
*
|
||||
*
|
||||
* @example <caption>Return unsubscribe function</caption>
|
||||
*
|
||||
* const observable = Rx.Observable.create(observer => {
|
||||
* const id = setTimeout(() => observer.next('...'), 5000); // emit value after 5s
|
||||
*
|
||||
* return () => { clearTimeout(id); console.log('cleared!'); };
|
||||
* });
|
||||
*
|
||||
* const subscription = observable.subscribe(value => console.log(value));
|
||||
*
|
||||
* setTimeout(() => subscription.unsubscribe(), 3000); // cancel subscription after 3s
|
||||
*
|
||||
* // Logs:
|
||||
* // "cleared!" after 3s
|
||||
*
|
||||
* // Never logs "..."
|
||||
*
|
||||
*
|
||||
* @see {@link empty}
|
||||
* @see {@link never}
|
||||
* @see {@link of}
|
||||
* @see {@link throw}
|
||||
*
|
||||
* @param {function(observer: Observer): TeardownLogic} onSubscription A
|
||||
* function that accepts an Observer, and invokes its `next`,
|
||||
* `error`, and `complete` methods as appropriate, and optionally returns some
|
||||
* logic for cleaning up resources.
|
||||
* @return {Observable} An Observable that, whenever subscribed, will execute the
|
||||
* specified function.
|
||||
* @static true
|
||||
* @name create
|
||||
* @owner Observable
|
||||
*/
|
||||
static create<T>(onSubscription: <R>(observer: Observer<R>) => TeardownLogic): Observable<T> {
|
||||
return new Observable<T>(onSubscription);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* An interface for a consumer of push-based notifications delivered by an
|
||||
* {@link Observable}.
|
||||
*
|
||||
* ```ts
|
||||
* interface Observer<T> {
|
||||
* closed?: boolean;
|
||||
* next: (value: T) => void;
|
||||
* error: (err: any) => void;
|
||||
* complete: () => void;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* An object conforming to the Observer interface is usually
|
||||
* given to the `observable.subscribe(observer)` method, and the Observable will
|
||||
* call the Observer's `next(value)` method to provide notifications. A
|
||||
* well-behaved Observable will call an Observer's `complete()` method exactly
|
||||
* once or the Observer's `error(err)` method exactly once, as the last
|
||||
* notification delivered.
|
||||
*
|
||||
* @interface
|
||||
* @name Observer
|
||||
* @noimport true
|
||||
*/
|
||||
export class ObserverDoc<T> {
|
||||
/**
|
||||
* An optional flag to indicate whether this Observer, when used as a
|
||||
* subscriber, has already been unsubscribed from its Observable.
|
||||
* @type {boolean}
|
||||
*/
|
||||
closed: boolean = false;
|
||||
/**
|
||||
* The callback to receive notifications of type `next` from the Observable,
|
||||
* with a value. The Observable may call this method 0 or more times.
|
||||
* @param {T} value The `next` value.
|
||||
* @return {void}
|
||||
*/
|
||||
next(value: T): void {
|
||||
return void 0;
|
||||
}
|
||||
/**
|
||||
* The callback to receive notifications of type `error` from the Observable,
|
||||
* with an attached {@link Error}. Notifies the Observer that the Observable
|
||||
* has experienced an error condition.
|
||||
* @param {any} err The `error` exception.
|
||||
* @return {void}
|
||||
*/
|
||||
error(err: any): void {
|
||||
return void 0;
|
||||
}
|
||||
/**
|
||||
* The callback to receive a valueless notification of type `complete` from
|
||||
* the Observable. Notifies the Observer that the Observable has finished
|
||||
* sending push-based notifications.
|
||||
* @return {void}
|
||||
*/
|
||||
complete(): void {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* `SubscribableOrPromise` interface describes values that behave like either
|
||||
* Observables or Promises. Every operator that accepts arguments annotated
|
||||
* with this interface, can be also used with parameters that are not necessarily
|
||||
* RxJS Observables.
|
||||
*
|
||||
* Following types of values might be passed to operators expecting this interface:
|
||||
*
|
||||
* ## Observable
|
||||
*
|
||||
* RxJS {@link Observable} instance.
|
||||
*
|
||||
* ## Observable-like (Subscribable)
|
||||
*
|
||||
* This might be any object that has `Symbol.observable` method. This method,
|
||||
* when called, should return object with `subscribe` method on it, which should
|
||||
* behave the same as RxJS `Observable.subscribe`.
|
||||
*
|
||||
* `Symbol.observable` is part of https://github.com/tc39/proposal-observable proposal.
|
||||
* Since currently it is not supported natively, and every symbol is equal only to itself,
|
||||
* you should use https://github.com/blesh/symbol-observable polyfill, when implementing
|
||||
* custom Observable-likes.
|
||||
*
|
||||
* **TypeScript Subscribable interface issue**
|
||||
*
|
||||
* Although TypeScript interface claims that Subscribable is an object that has `subscribe`
|
||||
* method declared directly on it, passing custom objects that have `subscribe`
|
||||
* method but not `Symbol.observable` method will fail at runtime. Conversely, passing
|
||||
* objects with `Symbol.observable` but without `subscribe` will fail at compile time
|
||||
* (if you use TypeScript).
|
||||
*
|
||||
* TypeScript has problem supporting interfaces with methods defined as symbol
|
||||
* properties. To get around that, you should implement `subscribe` directly on
|
||||
* passed object, and make `Symbol.observable` method simply return `this`. That way
|
||||
* everything will work as expected, and compiler will not complain. If you really
|
||||
* do not want to put `subscribe` directly on your object, you will have to type cast
|
||||
* it to `any`, before passing it to an operator.
|
||||
*
|
||||
* When this issue is resolved, Subscribable interface will only permit Observable-like
|
||||
* objects with `Symbol.observable` defined, no matter if they themselves implement
|
||||
* `subscribe` method or not.
|
||||
*
|
||||
* ## ES6 Promise
|
||||
*
|
||||
* Promise can be interpreted as Observable that emits value and completes
|
||||
* when it is resolved or errors when it is rejected.
|
||||
*
|
||||
* ## Promise-like (Thenable)
|
||||
*
|
||||
* Promises passed to operators do not have to be native ES6 Promises.
|
||||
* They can be implementations from popular Promise libraries, polyfills
|
||||
* or even custom ones. They just need to have `then` method that works
|
||||
* as the same as ES6 Promise `then`.
|
||||
*
|
||||
* @example <caption>Use merge and then map with non-RxJS observable</caption>
|
||||
* const nonRxJSObservable = {
|
||||
* subscribe(observer) {
|
||||
* observer.next(1000);
|
||||
* observer.complete();
|
||||
* },
|
||||
* [Symbol.observable]() {
|
||||
* return this;
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* Rx.Observable.merge(nonRxJSObservable)
|
||||
* .map(value => "This value is " + value)
|
||||
* .subscribe(result => console.log(result)); // Logs "This value is 1000"
|
||||
*
|
||||
*
|
||||
* @example <caption>Use combineLatest with ES6 Promise</caption>
|
||||
* Rx.Observable.combineLatest(Promise.resolve(5), Promise.resolve(10), Promise.resolve(15))
|
||||
* .subscribe(
|
||||
* value => console.log(value),
|
||||
* err => {},
|
||||
* () => console.log('the end!')
|
||||
* );
|
||||
* // Logs
|
||||
* // [5, 10, 15]
|
||||
* // "the end!"
|
||||
*
|
||||
*
|
||||
* @interface
|
||||
* @name SubscribableOrPromise
|
||||
* @noimport true
|
||||
*/
|
||||
export class SubscribableOrPromiseDoc<T> {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* `ObservableInput` interface describes all values that are either an
|
||||
* {@link SubscribableOrPromise} or some kind of collection of values that
|
||||
* can be transformed to Observable emitting that values. Every operator that
|
||||
* accepts arguments annotated with this interface, can be also used with
|
||||
* parameters that are not necessarily RxJS Observables.
|
||||
*
|
||||
* `ObservableInput` extends {@link SubscribableOrPromise} with following types:
|
||||
*
|
||||
* ## Array
|
||||
*
|
||||
* Arrays can be interpreted as observables that emit all values in array one by one,
|
||||
* from left to right, and then complete immediately.
|
||||
*
|
||||
* ## Array-like
|
||||
*
|
||||
* Arrays passed to operators do not have to be built-in JavaScript Arrays. They
|
||||
* can be also, for example, `arguments` property available inside every function,
|
||||
* [DOM NodeList](https://developer.mozilla.org/pl/docs/Web/API/NodeList),
|
||||
* or, actually, any object that has `length` property (which is a number)
|
||||
* and stores values under non-negative (zero and up) integers.
|
||||
*
|
||||
* ## ES6 Iterable
|
||||
*
|
||||
* Operators will accept both built-in and custom ES6 Iterables, by treating them as
|
||||
* observables that emit all its values in order of iteration and then complete
|
||||
* when iteration ends. Note that contrary to arrays, Iterables do not have to
|
||||
* necessarily be finite, so creating Observables that never complete is possible as well.
|
||||
*
|
||||
* Note that you can make iterator an instance of Iterable by having it return itself
|
||||
* in `Symbol.iterator` method. It means that every operator accepting Iterables accepts,
|
||||
* though indirectly, iterators themselves as well. All native ES6 iterators are instances
|
||||
* of Iterable by default, so you do not have to implement their `Symbol.iterator` method
|
||||
* yourself.
|
||||
*
|
||||
* **TypeScript Iterable interface issue**
|
||||
*
|
||||
* TypeScript `ObservableInput` interface actually lacks type signature for Iterables,
|
||||
* because of issues it caused in some projects (see [this issue](https://github.com/ReactiveX/rxjs/issues/2306)).
|
||||
* If you want to use Iterable as argument for operator, cast it to `any` first.
|
||||
* Remember of course that, because of casting, you have to yourself ensure that passed
|
||||
* argument really implements said interface.
|
||||
*
|
||||
*
|
||||
* @example <caption>Use merge with arrays</caption>
|
||||
* Rx.Observable.merge([1, 2], [4], [5, 6])
|
||||
* .subscribe(
|
||||
* value => console.log(value),
|
||||
* err => {},
|
||||
* () => console.log('ta dam!')
|
||||
* );
|
||||
*
|
||||
* // Logs
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // 4
|
||||
* // 5
|
||||
* // 6
|
||||
* // "ta dam!"
|
||||
*
|
||||
*
|
||||
* @example <caption>Use merge with array-like</caption>
|
||||
* Rx.Observable.merge({0: 1, 1: 2, length: 2}, {0: 3, length: 1})
|
||||
* .subscribe(
|
||||
* value => console.log(value),
|
||||
* err => {},
|
||||
* () => console.log('nice, huh?')
|
||||
* );
|
||||
*
|
||||
* // Logs
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // "nice, huh?"
|
||||
*
|
||||
* @example <caption>Use merge with an Iterable (Map)</caption>
|
||||
* const firstMap = new Map([[1, 'a'], [2, 'b']]);
|
||||
* const secondMap = new Map([[3, 'c'], [4, 'd']]);
|
||||
*
|
||||
* Rx.Observable.merge(
|
||||
* firstMap, // pass Iterable
|
||||
* secondMap.values() // pass iterator, which is itself an Iterable
|
||||
* ).subscribe(
|
||||
* value => console.log(value),
|
||||
* err => {},
|
||||
* () => console.log('yup!')
|
||||
* );
|
||||
*
|
||||
* // Logs
|
||||
* // [1, "a"]
|
||||
* // [2, "b"]
|
||||
* // "c"
|
||||
* // "d"
|
||||
* // "yup!"
|
||||
*
|
||||
* @example <caption>Use from with generator (returning infinite iterator)</caption>
|
||||
* // infinite stream of incrementing numbers
|
||||
* const infinite = function* () {
|
||||
* let i = 0;
|
||||
*
|
||||
* while (true) {
|
||||
* yield i++;
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* Rx.Observable.from(infinite())
|
||||
* .take(3) // only take 3, cause this is infinite
|
||||
* .subscribe(
|
||||
* value => console.log(value),
|
||||
* err => {},
|
||||
* () => console.log('ta dam!')
|
||||
* );
|
||||
*
|
||||
* // Logs
|
||||
* // 0
|
||||
* // 1
|
||||
* // 2
|
||||
* // "ta dam!"
|
||||
*
|
||||
* @interface
|
||||
* @name ObservableInput
|
||||
* @noimport true
|
||||
*/
|
||||
export class ObservableInputDoc<T> {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* This interface describes what should be returned by function passed to Observable
|
||||
* constructor or static {@link create} function. Value of that interface will be used
|
||||
* to cancel subscription for given Observable.
|
||||
*
|
||||
* `TeardownLogic` can be:
|
||||
*
|
||||
* ## Function
|
||||
*
|
||||
* Function that takes no parameters. When consumer of created Observable calls `unsubscribe`,
|
||||
* that function will be called
|
||||
*
|
||||
* ## AnonymousSubscription
|
||||
*
|
||||
* `AnonymousSubscription` is simply an object with `unsubscribe` method on it. That method
|
||||
* will work the same as function
|
||||
*
|
||||
* ## void
|
||||
*
|
||||
* If created Observable does not have any resources to clean up, function does not have to
|
||||
* return anything.
|
||||
*
|
||||
* @interface
|
||||
* @name TeardownLogic
|
||||
* @noimport true
|
||||
*/
|
||||
export class TeardownLogicDoc {
|
||||
|
||||
}
|
131
node_modules/rxjs/src/Notification.ts
generated
vendored
Normal file
131
node_modules/rxjs/src/Notification.ts
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
import { PartialObserver } from './Observer';
|
||||
import { Observable } from './Observable';
|
||||
|
||||
/**
|
||||
* Represents a push-based event or value that an {@link Observable} can emit.
|
||||
* This class is particularly useful for operators that manage notifications,
|
||||
* like {@link materialize}, {@link dematerialize}, {@link observeOn}, and
|
||||
* others. Besides wrapping the actual delivered value, it also annotates it
|
||||
* with metadata of, for instance, what type of push message it is (`next`,
|
||||
* `error`, or `complete`).
|
||||
*
|
||||
* @see {@link materialize}
|
||||
* @see {@link dematerialize}
|
||||
* @see {@link observeOn}
|
||||
*
|
||||
* @class Notification<T>
|
||||
*/
|
||||
export class Notification<T> {
|
||||
hasValue: boolean;
|
||||
|
||||
constructor(public kind: string, public value?: T, public error?: any) {
|
||||
this.hasValue = kind === 'N';
|
||||
}
|
||||
|
||||
/**
|
||||
* Delivers to the given `observer` the value wrapped by this Notification.
|
||||
* @param {Observer} observer
|
||||
* @return
|
||||
*/
|
||||
observe(observer: PartialObserver<T>): any {
|
||||
switch (this.kind) {
|
||||
case 'N':
|
||||
return observer.next && observer.next(this.value);
|
||||
case 'E':
|
||||
return observer.error && observer.error(this.error);
|
||||
case 'C':
|
||||
return observer.complete && observer.complete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given some {@link Observer} callbacks, deliver the value represented by the
|
||||
* current Notification to the correctly corresponding callback.
|
||||
* @param {function(value: T): void} next An Observer `next` callback.
|
||||
* @param {function(err: any): void} [error] An Observer `error` callback.
|
||||
* @param {function(): void} [complete] An Observer `complete` callback.
|
||||
* @return {any}
|
||||
*/
|
||||
do(next: (value: T) => void, error?: (err: any) => void, complete?: () => void): any {
|
||||
const kind = this.kind;
|
||||
switch (kind) {
|
||||
case 'N':
|
||||
return next && next(this.value);
|
||||
case 'E':
|
||||
return error && error(this.error);
|
||||
case 'C':
|
||||
return complete && complete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an Observer or its individual callback functions, and calls `observe`
|
||||
* or `do` methods accordingly.
|
||||
* @param {Observer|function(value: T): void} nextOrObserver An Observer or
|
||||
* the `next` callback.
|
||||
* @param {function(err: any): void} [error] An Observer `error` callback.
|
||||
* @param {function(): void} [complete] An Observer `complete` callback.
|
||||
* @return {any}
|
||||
*/
|
||||
accept(nextOrObserver: PartialObserver<T> | ((value: T) => void), error?: (err: any) => void, complete?: () => void) {
|
||||
if (nextOrObserver && typeof (<PartialObserver<T>>nextOrObserver).next === 'function') {
|
||||
return this.observe(<PartialObserver<T>>nextOrObserver);
|
||||
} else {
|
||||
return this.do(<(value: T) => void>nextOrObserver, error, complete);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a simple Observable that just delivers the notification represented
|
||||
* by this Notification instance.
|
||||
* @return {any}
|
||||
*/
|
||||
toObservable(): Observable<T> {
|
||||
const kind = this.kind;
|
||||
switch (kind) {
|
||||
case 'N':
|
||||
return Observable.of(this.value);
|
||||
case 'E':
|
||||
return Observable.throw(this.error);
|
||||
case 'C':
|
||||
return Observable.empty<T>();
|
||||
}
|
||||
throw new Error('unexpected notification kind value');
|
||||
}
|
||||
|
||||
private static completeNotification: Notification<any> = new Notification('C');
|
||||
private static undefinedValueNotification: Notification<any> = new Notification('N', undefined);
|
||||
|
||||
/**
|
||||
* A shortcut to create a Notification instance of the type `next` from a
|
||||
* given value.
|
||||
* @param {T} value The `next` value.
|
||||
* @return {Notification<T>} The "next" Notification representing the
|
||||
* argument.
|
||||
*/
|
||||
static createNext<T>(value: T): Notification<T> {
|
||||
if (typeof value !== 'undefined') {
|
||||
return new Notification('N', value);
|
||||
}
|
||||
return Notification.undefinedValueNotification;
|
||||
}
|
||||
|
||||
/**
|
||||
* A shortcut to create a Notification instance of the type `error` from a
|
||||
* given error.
|
||||
* @param {any} [err] The `error` error.
|
||||
* @return {Notification<T>} The "error" Notification representing the
|
||||
* argument.
|
||||
*/
|
||||
static createError<T>(err?: any): Notification<T> {
|
||||
return new Notification('E', undefined, err);
|
||||
}
|
||||
|
||||
/**
|
||||
* A shortcut to create a Notification instance of the type `complete`.
|
||||
* @return {Notification<any>} The valueless "complete" Notification.
|
||||
*/
|
||||
static createComplete(): Notification<any> {
|
||||
return Notification.completeNotification;
|
||||
}
|
||||
}
|
355
node_modules/rxjs/src/Observable.ts
generated
vendored
Normal file
355
node_modules/rxjs/src/Observable.ts
generated
vendored
Normal file
@@ -0,0 +1,355 @@
|
||||
import { PartialObserver } from './Observer';
|
||||
import { Operator } from './Operator';
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { Subscription, AnonymousSubscription, TeardownLogic } from './Subscription';
|
||||
import { root } from './util/root';
|
||||
import { toSubscriber } from './util/toSubscriber';
|
||||
import { IfObservable } from './observable/IfObservable';
|
||||
import { ErrorObservable } from './observable/ErrorObservable';
|
||||
import { observable as Symbol_observable } from './symbol/observable';
|
||||
import { OperatorFunction } from './interfaces';
|
||||
import { pipeFromArray } from './util/pipe';
|
||||
|
||||
export interface Subscribable<T> {
|
||||
subscribe(observerOrNext?: PartialObserver<T> | ((value: T) => void),
|
||||
error?: (error: any) => void,
|
||||
complete?: () => void): AnonymousSubscription;
|
||||
}
|
||||
|
||||
export type SubscribableOrPromise<T> = Subscribable<T> | PromiseLike<T>;
|
||||
export type ObservableInput<T> = SubscribableOrPromise<T> | ArrayLike<T>;
|
||||
|
||||
/**
|
||||
* A representation of any set of values over any amount of time. This is the most basic building block
|
||||
* of RxJS.
|
||||
*
|
||||
* @class Observable<T>
|
||||
*/
|
||||
export class Observable<T> implements Subscribable<T> {
|
||||
|
||||
public _isScalar: boolean = false;
|
||||
|
||||
/** @deprecated internal use only */ public source: Observable<any>;
|
||||
protected operator: Operator<any, T>;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Function} subscribe the function that is called when the Observable is
|
||||
* initially subscribed to. This function is given a Subscriber, to which new values
|
||||
* can be `next`ed, or an `error` method can be called to raise an error, or
|
||||
* `complete` can be called to notify of a successful completion.
|
||||
*/
|
||||
constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {
|
||||
if (subscribe) {
|
||||
this._subscribe = subscribe;
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: Since TypeScript inherits static properties too, we have to
|
||||
// fight against TypeScript here so Subject can have a different static create signature
|
||||
/**
|
||||
* Creates a new cold Observable by calling the Observable constructor
|
||||
* @static true
|
||||
* @owner Observable
|
||||
* @method create
|
||||
* @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
|
||||
* @return {Observable} a new cold observable
|
||||
*/
|
||||
static create: Function = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {
|
||||
return new Observable<T>(subscribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Observable, with this Observable as the source, and the passed
|
||||
* operator defined as the new observable's operator.
|
||||
* @method lift
|
||||
* @param {Operator} operator the operator defining the operation to take on the observable
|
||||
* @return {Observable} a new observable with the Operator applied
|
||||
*/
|
||||
lift<R>(operator: Operator<T, R>): Observable<R> {
|
||||
const observable = new Observable<R>();
|
||||
observable.source = this;
|
||||
observable.operator = operator;
|
||||
return observable;
|
||||
}
|
||||
|
||||
subscribe(observer?: PartialObserver<T>): Subscription;
|
||||
subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;
|
||||
/**
|
||||
* Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.
|
||||
*
|
||||
* <span class="informal">Use it when you have all these Observables, but still nothing is happening.</span>
|
||||
*
|
||||
* `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It
|
||||
* might be for example a function that you passed to a {@link create} static factory, but most of the time it is
|
||||
* a library implementation, which defines what and when will be emitted by an Observable. This means that calling
|
||||
* `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often
|
||||
* thought.
|
||||
*
|
||||
* Apart from starting the execution of an Observable, this method allows you to listen for values
|
||||
* that an Observable emits, as well as for when it completes or errors. You can achieve this in two
|
||||
* following ways.
|
||||
*
|
||||
* The first way is creating an object that implements {@link Observer} interface. It should have methods
|
||||
* defined by that interface, but note that it should be just a regular JavaScript object, which you can create
|
||||
* yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do
|
||||
* not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also
|
||||
* that your object does not have to implement all methods. If you find yourself creating a method that doesn't
|
||||
* do anything, you can simply omit it. Note however, that if `error` method is not provided, all errors will
|
||||
* be left uncaught.
|
||||
*
|
||||
* The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.
|
||||
* This means you can provide three functions as arguments to `subscribe`, where first function is equivalent
|
||||
* of a `next` method, second of an `error` method and third of a `complete` method. Just as in case of Observer,
|
||||
* if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,
|
||||
* since `subscribe` recognizes these functions by where they were placed in function call. When it comes
|
||||
* to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.
|
||||
*
|
||||
* Whatever style of calling `subscribe` you use, in both cases it returns a Subscription object.
|
||||
* This object allows you to call `unsubscribe` on it, which in turn will stop work that an Observable does and will clean
|
||||
* up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback
|
||||
* provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.
|
||||
*
|
||||
* Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.
|
||||
* It is an Observable itself that decides when these functions will be called. For example {@link of}
|
||||
* by default emits all its values synchronously. Always check documentation for how given Observable
|
||||
* will behave when subscribed and if its default behavior can be modified with a {@link Scheduler}.
|
||||
*
|
||||
* @example <caption>Subscribe with an Observer</caption>
|
||||
* const sumObserver = {
|
||||
* sum: 0,
|
||||
* next(value) {
|
||||
* console.log('Adding: ' + value);
|
||||
* this.sum = this.sum + value;
|
||||
* },
|
||||
* error() { // We actually could just remove this method,
|
||||
* }, // since we do not really care about errors right now.
|
||||
* complete() {
|
||||
* console.log('Sum equals: ' + this.sum);
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* Rx.Observable.of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.
|
||||
* .subscribe(sumObserver);
|
||||
*
|
||||
* // Logs:
|
||||
* // "Adding: 1"
|
||||
* // "Adding: 2"
|
||||
* // "Adding: 3"
|
||||
* // "Sum equals: 6"
|
||||
*
|
||||
*
|
||||
* @example <caption>Subscribe with functions</caption>
|
||||
* let sum = 0;
|
||||
*
|
||||
* Rx.Observable.of(1, 2, 3)
|
||||
* .subscribe(
|
||||
* function(value) {
|
||||
* console.log('Adding: ' + value);
|
||||
* sum = sum + value;
|
||||
* },
|
||||
* undefined,
|
||||
* function() {
|
||||
* console.log('Sum equals: ' + sum);
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* // Logs:
|
||||
* // "Adding: 1"
|
||||
* // "Adding: 2"
|
||||
* // "Adding: 3"
|
||||
* // "Sum equals: 6"
|
||||
*
|
||||
*
|
||||
* @example <caption>Cancel a subscription</caption>
|
||||
* const subscription = Rx.Observable.interval(1000).subscribe(
|
||||
* num => console.log(num),
|
||||
* undefined,
|
||||
* () => console.log('completed!') // Will not be called, even
|
||||
* ); // when cancelling subscription
|
||||
*
|
||||
*
|
||||
* setTimeout(() => {
|
||||
* subscription.unsubscribe();
|
||||
* console.log('unsubscribed!');
|
||||
* }, 2500);
|
||||
*
|
||||
* // Logs:
|
||||
* // 0 after 1s
|
||||
* // 1 after 2s
|
||||
* // "unsubscribed!" after 2.5s
|
||||
*
|
||||
*
|
||||
* @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,
|
||||
* or the first of three possible handlers, which is the handler for each value emitted from the subscribed
|
||||
* Observable.
|
||||
* @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,
|
||||
* the error will be thrown as unhandled.
|
||||
* @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.
|
||||
* @return {ISubscription} a subscription reference to the registered handlers
|
||||
* @method subscribe
|
||||
*/
|
||||
subscribe(observerOrNext?: PartialObserver<T> | ((value: T) => void),
|
||||
error?: (error: any) => void,
|
||||
complete?: () => void): Subscription {
|
||||
|
||||
const { operator } = this;
|
||||
const sink = toSubscriber(observerOrNext, error, complete);
|
||||
|
||||
if (operator) {
|
||||
operator.call(sink, this.source);
|
||||
} else {
|
||||
sink.add(this.source || !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
|
||||
}
|
||||
|
||||
if (sink.syncErrorThrowable) {
|
||||
sink.syncErrorThrowable = false;
|
||||
if (sink.syncErrorThrown) {
|
||||
throw sink.syncErrorValue;
|
||||
}
|
||||
}
|
||||
|
||||
return sink;
|
||||
}
|
||||
|
||||
protected _trySubscribe(sink: Subscriber<T>): TeardownLogic {
|
||||
try {
|
||||
return this._subscribe(sink);
|
||||
} catch (err) {
|
||||
sink.syncErrorThrown = true;
|
||||
sink.syncErrorValue = err;
|
||||
sink.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @method forEach
|
||||
* @param {Function} next a handler for each value emitted by the observable
|
||||
* @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise
|
||||
* @return {Promise} a promise that either resolves on observable completion or
|
||||
* rejects with the handled error
|
||||
*/
|
||||
forEach(next: (value: T) => void, PromiseCtor?: typeof Promise): Promise<void> {
|
||||
if (!PromiseCtor) {
|
||||
if (root.Rx && root.Rx.config && root.Rx.config.Promise) {
|
||||
PromiseCtor = root.Rx.config.Promise;
|
||||
} else if (root.Promise) {
|
||||
PromiseCtor = root.Promise;
|
||||
}
|
||||
}
|
||||
|
||||
if (!PromiseCtor) {
|
||||
throw new Error('no Promise impl found');
|
||||
}
|
||||
|
||||
return new PromiseCtor<void>((resolve, reject) => {
|
||||
// Must be declared in a separate statement to avoid a RefernceError when
|
||||
// accessing subscription below in the closure due to Temporal Dead Zone.
|
||||
let subscription: Subscription;
|
||||
subscription = this.subscribe((value) => {
|
||||
if (subscription) {
|
||||
// if there is a subscription, then we can surmise
|
||||
// the next handling is asynchronous. Any errors thrown
|
||||
// need to be rejected explicitly and unsubscribe must be
|
||||
// called manually
|
||||
try {
|
||||
next(value);
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
} else {
|
||||
// if there is NO subscription, then we're getting a nexted
|
||||
// value synchronously during subscription. We can just call it.
|
||||
// If it errors, Observable's `subscribe` will ensure the
|
||||
// unsubscription logic is called, then synchronously rethrow the error.
|
||||
// After that, Promise will trap the error and send it
|
||||
// down the rejection path.
|
||||
next(value);
|
||||
}
|
||||
}, reject, resolve);
|
||||
});
|
||||
}
|
||||
|
||||
/** @deprecated internal use only */ _subscribe(subscriber: Subscriber<any>): TeardownLogic {
|
||||
return this.source.subscribe(subscriber);
|
||||
}
|
||||
|
||||
// `if` and `throw` are special snow flakes, the compiler sees them as reserved words
|
||||
static if: typeof IfObservable.create;
|
||||
static throw: typeof ErrorObservable.create;
|
||||
|
||||
/**
|
||||
* An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable
|
||||
* @method Symbol.observable
|
||||
* @return {Observable} this instance of the observable
|
||||
*/
|
||||
[Symbol_observable]() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
pipe(): Observable<T>
|
||||
pipe<A>(op1: OperatorFunction<T, A>): Observable<A>
|
||||
pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>
|
||||
pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>
|
||||
pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>
|
||||
pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>
|
||||
pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>
|
||||
pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>
|
||||
pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>
|
||||
pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>
|
||||
pipe<R>(...operations: OperatorFunction<T, R>[]): Observable<R>
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
/**
|
||||
* Used to stitch together functional operators into a chain.
|
||||
* @method pipe
|
||||
* @return {Observable} the Observable result of all of the operators having
|
||||
* been called in the order they were passed in.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* import { map, filter, scan } from 'rxjs/operators';
|
||||
*
|
||||
* Rx.Observable.interval(1000)
|
||||
* .pipe(
|
||||
* filter(x => x % 2 === 0),
|
||||
* map(x => x + x),
|
||||
* scan((acc, x) => acc + x)
|
||||
* )
|
||||
* .subscribe(x => console.log(x))
|
||||
*/
|
||||
pipe<R>(...operations: OperatorFunction<T, R>[]): Observable<R> {
|
||||
if (operations.length === 0) {
|
||||
return this as any;
|
||||
}
|
||||
|
||||
return pipeFromArray(operations)(this);
|
||||
}
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
toPromise<T>(this: Observable<T>): Promise<T>;
|
||||
toPromise<T>(this: Observable<T>, PromiseCtor: typeof Promise): Promise<T>;
|
||||
toPromise<T>(this: Observable<T>, PromiseCtor: PromiseConstructorLike): Promise<T>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
toPromise(PromiseCtor?: PromiseConstructorLike) {
|
||||
if (!PromiseCtor) {
|
||||
if (root.Rx && root.Rx.config && root.Rx.config.Promise) {
|
||||
PromiseCtor = root.Rx.config.Promise;
|
||||
} else if (root.Promise) {
|
||||
PromiseCtor = root.Promise;
|
||||
}
|
||||
}
|
||||
|
||||
if (!PromiseCtor) {
|
||||
throw new Error('no Promise impl found');
|
||||
}
|
||||
|
||||
return new PromiseCtor((resolve, reject) => {
|
||||
let value: any;
|
||||
this.subscribe((x: T) => value = x, (err: any) => reject(err), () => resolve(value));
|
||||
}) as Promise<T>;
|
||||
}
|
||||
}
|
36
node_modules/rxjs/src/Observer.ts
generated
vendored
Normal file
36
node_modules/rxjs/src/Observer.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
export interface NextObserver<T> {
|
||||
closed?: boolean;
|
||||
next: (value: T) => void;
|
||||
error?: (err: any) => void;
|
||||
complete?: () => void;
|
||||
}
|
||||
|
||||
export interface ErrorObserver<T> {
|
||||
closed?: boolean;
|
||||
next?: (value: T) => void;
|
||||
error: (err: any) => void;
|
||||
complete?: () => void;
|
||||
}
|
||||
|
||||
export interface CompletionObserver<T> {
|
||||
closed?: boolean;
|
||||
next?: (value: T) => void;
|
||||
error?: (err: any) => void;
|
||||
complete: () => void;
|
||||
}
|
||||
|
||||
export type PartialObserver<T> = NextObserver<T> | ErrorObserver<T> | CompletionObserver<T>;
|
||||
|
||||
export interface Observer<T> {
|
||||
closed?: boolean;
|
||||
next: (value: T) => void;
|
||||
error: (err: any) => void;
|
||||
complete: () => void;
|
||||
}
|
||||
|
||||
export const empty: Observer<any> = {
|
||||
closed: true,
|
||||
next(value: any): void { /* noop */},
|
||||
error(err: any): void { throw err; },
|
||||
complete(): void { /*noop*/ }
|
||||
};
|
6
node_modules/rxjs/src/Operator.ts
generated
vendored
Normal file
6
node_modules/rxjs/src/Operator.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { TeardownLogic } from './Subscription';
|
||||
|
||||
export interface Operator<T, R> {
|
||||
call(subscriber: Subscriber<R>, source: any): TeardownLogic;
|
||||
}
|
23
node_modules/rxjs/src/OuterSubscriber.ts
generated
vendored
Normal file
23
node_modules/rxjs/src/OuterSubscriber.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { InnerSubscriber } from './InnerSubscriber';
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
export class OuterSubscriber<T, R> extends Subscriber<T> {
|
||||
notifyNext(outerValue: T, innerValue: R,
|
||||
outerIndex: number, innerIndex: number,
|
||||
innerSub: InnerSubscriber<T, R>): void {
|
||||
this.destination.next(innerValue);
|
||||
}
|
||||
|
||||
notifyError(error: any, innerSub: InnerSubscriber<T, R>): void {
|
||||
this.destination.error(error);
|
||||
}
|
||||
|
||||
notifyComplete(innerSub: InnerSubscriber<T, R>): void {
|
||||
this.destination.complete();
|
||||
}
|
||||
}
|
206
node_modules/rxjs/src/README.md
generated
vendored
Normal file
206
node_modules/rxjs/src/README.md
generated
vendored
Normal file
@@ -0,0 +1,206 @@
|
||||
[](https://travis-ci.org/ReactiveX/rxjs)
|
||||
[](https://coveralls.io/github/ReactiveX/rxjs?branch=master)
|
||||
[](http://badge.fury.io/js/%40reactivex%2Frxjs)
|
||||
[](https://gitter.im/Reactive-Extensions/RxJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
[](https://saucelabs.com/u/rxjs5)
|
||||
|
||||
# RxJS 5
|
||||
|
||||
Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Extensions/RxJS](https://github.com/Reactive-Extensions/RxJS) and is the latest production-ready version of RxJS. This rewrite is meant to have better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface.
|
||||
|
||||
[Apache 2.0 License](LICENSE.txt)
|
||||
|
||||
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
||||
- [Contribution Guidelines](CONTRIBUTING.md)
|
||||
- [Maintainer Guidelines](doc/maintainer-guidelines.md)
|
||||
- [Creating Operators](doc/operator-creation.md)
|
||||
- [Migrating From RxJS 4 to RxJS 5](MIGRATION.md)
|
||||
- [API Documentation (WIP)](http://reactivex.io/rxjs)
|
||||
|
||||
## Versions In This Repository
|
||||
|
||||
- [master](https://github.com/ReactiveX/rxjs/commits/master) - commits that will be included in the next _minor_ or _patch_ release
|
||||
- [next](https://github.com/ReactiveX/rxjs/commits/next) - commits that will be included in the next _major_ release (breaking changes)
|
||||
|
||||
Most PRs should be made to **master**, unless you know it is a breaking change.
|
||||
|
||||
## Important
|
||||
|
||||
By contributing or commenting on issues in this repository, whether you've read them or not, you're agreeing to the [Contributor Code of Conduct](CODE_OF_CONDUCT.md). Much like traffic laws, ignorance doesn't grant you immunity.
|
||||
|
||||
## Installation and Usage
|
||||
|
||||
### ES6 via npm
|
||||
|
||||
```sh
|
||||
npm install rxjs
|
||||
```
|
||||
|
||||
To import the entire core set of functionality:
|
||||
|
||||
```js
|
||||
import Rx from 'rxjs/Rx';
|
||||
|
||||
Rx.Observable.of(1,2,3)
|
||||
```
|
||||
|
||||
To import only what you need by patching (this is useful for size-sensitive bundling):
|
||||
|
||||
```js
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
Observable.of(1,2,3).map(x => x + '!!!'); // etc
|
||||
```
|
||||
|
||||
To import what you need and use it with proposed [bind operator](https://github.com/tc39/proposal-bind-operator):
|
||||
|
||||
> Note: This additional syntax requires [transpiler support](http://babeljs.io/docs/plugins/transform-function-bind/) and this syntax may be completely withdrawn from TC39 without notice! Use at your own risk.
|
||||
|
||||
```js
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { of } from 'rxjs/observable/of';
|
||||
import { map } from 'rxjs/operator/map';
|
||||
|
||||
Observable::of(1,2,3)::map(x => x + '!!!'); // etc
|
||||
```
|
||||
|
||||
### CommonJS via npm
|
||||
|
||||
To install this library for CommonJS (CJS) usage, use the following command:
|
||||
|
||||
```sh
|
||||
npm install rxjs
|
||||
```
|
||||
|
||||
Import all core functionality:
|
||||
|
||||
```js
|
||||
var Rx = require('rxjs/Rx');
|
||||
|
||||
Rx.Observable.of(1,2,3); // etc
|
||||
```
|
||||
|
||||
Import only what you need and patch Observable (this is useful in size-sensitive bundling scenarios):
|
||||
|
||||
```js
|
||||
var Observable = require('rxjs/Observable').Observable;
|
||||
// patch Observable with appropriate methods
|
||||
require('rxjs/add/observable/of');
|
||||
require('rxjs/add/operator/map');
|
||||
|
||||
Observable.of(1,2,3).map(function (x) { return x + '!!!'; }); // etc
|
||||
```
|
||||
|
||||
Import operators and use them _manually_ you can do the following (this is also useful for bundling):
|
||||
|
||||
```js
|
||||
var of = require('rxjs/observable/of').of;
|
||||
var map = require('rxjs/operator/map').map;
|
||||
|
||||
map.call(of(1,2,3), function (x) { return x + '!!!'; });
|
||||
```
|
||||
|
||||
You can also use the above method to build your own Observable and export it from your own module.
|
||||
|
||||
|
||||
### All Module Types (CJS/ES6/AMD/TypeScript) via npm
|
||||
|
||||
To install this library via [npm](https://www.npmjs.org) **version 3**, use the following command:
|
||||
|
||||
```sh
|
||||
npm install @reactivex/rxjs
|
||||
```
|
||||
|
||||
This will include CJS/Global builds and can be used for all module types.
|
||||
|
||||
If you are using npm **version 2** before this library has achieved a stable version, you need to specify the library version explicitly:
|
||||
|
||||
```sh
|
||||
npm install @reactivex/rxjs@5.0.0
|
||||
```
|
||||
|
||||
### CDN
|
||||
|
||||
For CDN, you can use [unpkg](https://unpkg.com/):
|
||||
|
||||
https://unpkg.com/rxjs@version/bundles/Rx.min.js
|
||||
|
||||
*replace **version** with the current version. See [docs](http://reactivex.io/rxjs/manual/installation.html#cdn).*
|
||||
|
||||
#### Node.js Usage:
|
||||
|
||||
```js
|
||||
var Rx = require('@reactivex/rxjs');
|
||||
|
||||
Rx.Observable.of('hello world')
|
||||
.subscribe(function(x) { console.log(x); });
|
||||
```
|
||||
|
||||
## Goals
|
||||
|
||||
- Provide better performance than preceding versions of RxJS
|
||||
- To model/follow the [Observable Spec Proposal](https://github.com/zenparsing/es-observable) to the observable.
|
||||
- Provide more modular file structure in a variety of formats
|
||||
- Provide more debuggable call stacks than preceding versions of RxJS
|
||||
|
||||
## Building/Testing
|
||||
|
||||
The build and test structure is fairly primitive at the moment. There are various npm scripts that can be run:
|
||||
|
||||
- build_es6: Transpiles the TypeScript files from `src/` to `dist/es6`
|
||||
- build_cjs: Transpiles the ES6 files from `dist/es6` to `dist/cjs`
|
||||
- build_amd: Transpiles the ES6 files from `dist/es6` to `dist/amd`
|
||||
- build_global: Transpiles/Bundles the CommonJS files from `dist/cjs` to `dist/global/Rx.js`
|
||||
- build_all: Performs all of the above in the proper order.
|
||||
- build_test: builds ES6, then CommonJS, then runs the tests with `jasmine`
|
||||
- build_perf: builds ES6, CommonJS, then global, then runs the performance tests with `protractor`
|
||||
- build_docs: generates API documentation from `dist/es6` to `dist/docs`
|
||||
- build_cover: runs `istanbul` code coverage against test cases
|
||||
- test: runs tests with `jasmine`, must have built prior to running.
|
||||
- tests2png: generates PNG marble diagrams from test cases.
|
||||
|
||||
`npm run info` will list available script.
|
||||
|
||||
### Example
|
||||
|
||||
```sh
|
||||
# build all the things!
|
||||
npm run build_all
|
||||
```
|
||||
|
||||
## Performance Tests
|
||||
|
||||
Run `npm run build_perf` or `npm run perf` to run the performance tests with `protractor`.
|
||||
Run `npm run perf_micro` to run micro performance test benchmarking operator.
|
||||
|
||||
## Adding documentation
|
||||
RxNext uses [ESDoc](https://esdoc.org/) to generate API documentation. Refer to ESDoc's documentation for syntax. Run `npm run build_docs` to generate.
|
||||
|
||||
## Generating PNG marble diagrams
|
||||
|
||||
The script `npm run tests2png` requires some native packages installed locally: `imagemagick`, `graphicsmagick`, and `ghostscript`.
|
||||
|
||||
For Mac OS X with [Homebrew](http://brew.sh/):
|
||||
|
||||
- `brew install imagemagick`
|
||||
- `brew install graphicsmagick`
|
||||
- `brew install ghostscript`
|
||||
- You may need to install the Ghostscript fonts manually:
|
||||
- Download the tarball from the [gs-fonts project](https://sourceforge.net/projects/gs-fonts)
|
||||
- `mkdir -p /usr/local/share/ghostscript && tar zxvf /path/to/ghostscript-fonts.tar.gz -C /usr/local/share/ghostscript`
|
||||
|
||||
For Debian Linux:
|
||||
|
||||
- `sudo add-apt-repository ppa:dhor/myway`
|
||||
- `apt-get install imagemagick`
|
||||
- `apt-get install graphicsmagick`
|
||||
- `apt-get install ghostscript`
|
||||
|
||||
For Windows and other Operating Systems, check the download instructions here:
|
||||
|
||||
- http://imagemagick.org
|
||||
- http://www.graphicsmagick.org
|
||||
- http://www.ghostscript.com/
|
104
node_modules/rxjs/src/ReplaySubject.ts
generated
vendored
Normal file
104
node_modules/rxjs/src/ReplaySubject.ts
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
import { Subject } from './Subject';
|
||||
import { IScheduler } from './Scheduler';
|
||||
import { queue } from './scheduler/queue';
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { Subscription } from './Subscription';
|
||||
import { ObserveOnSubscriber } from './operators/observeOn';
|
||||
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
|
||||
import { SubjectSubscription } from './SubjectSubscription';
|
||||
/**
|
||||
* @class ReplaySubject<T>
|
||||
*/
|
||||
export class ReplaySubject<T> extends Subject<T> {
|
||||
private _events: ReplayEvent<T>[] = [];
|
||||
private _bufferSize: number;
|
||||
private _windowTime: number;
|
||||
|
||||
constructor(bufferSize: number = Number.POSITIVE_INFINITY,
|
||||
windowTime: number = Number.POSITIVE_INFINITY,
|
||||
private scheduler?: IScheduler) {
|
||||
super();
|
||||
this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
|
||||
this._windowTime = windowTime < 1 ? 1 : windowTime;
|
||||
}
|
||||
|
||||
next(value: T): void {
|
||||
const now = this._getNow();
|
||||
this._events.push(new ReplayEvent(now, value));
|
||||
this._trimBufferThenGetEvents();
|
||||
super.next(value);
|
||||
}
|
||||
|
||||
/** @deprecated internal use only */ _subscribe(subscriber: Subscriber<T>): Subscription {
|
||||
const _events = this._trimBufferThenGetEvents();
|
||||
const scheduler = this.scheduler;
|
||||
let subscription: Subscription;
|
||||
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
} else if (this.hasError) {
|
||||
subscription = Subscription.EMPTY;
|
||||
} else if (this.isStopped) {
|
||||
subscription = Subscription.EMPTY;
|
||||
} else {
|
||||
this.observers.push(subscriber);
|
||||
subscription = new SubjectSubscription(this, subscriber);
|
||||
}
|
||||
|
||||
if (scheduler) {
|
||||
subscriber.add(subscriber = new ObserveOnSubscriber<T>(subscriber, scheduler));
|
||||
}
|
||||
|
||||
const len = _events.length;
|
||||
for (let i = 0; i < len && !subscriber.closed; i++) {
|
||||
subscriber.next(_events[i].value);
|
||||
}
|
||||
|
||||
if (this.hasError) {
|
||||
subscriber.error(this.thrownError);
|
||||
} else if (this.isStopped) {
|
||||
subscriber.complete();
|
||||
}
|
||||
|
||||
return subscription;
|
||||
}
|
||||
|
||||
_getNow(): number {
|
||||
return (this.scheduler || queue).now();
|
||||
}
|
||||
|
||||
private _trimBufferThenGetEvents(): ReplayEvent<T>[] {
|
||||
const now = this._getNow();
|
||||
const _bufferSize = this._bufferSize;
|
||||
const _windowTime = this._windowTime;
|
||||
const _events = this._events;
|
||||
|
||||
let eventsCount = _events.length;
|
||||
let spliceCount = 0;
|
||||
|
||||
// Trim events that fall out of the time window.
|
||||
// Start at the front of the list. Break early once
|
||||
// we encounter an event that falls within the window.
|
||||
while (spliceCount < eventsCount) {
|
||||
if ((now - _events[spliceCount].time) < _windowTime) {
|
||||
break;
|
||||
}
|
||||
spliceCount++;
|
||||
}
|
||||
|
||||
if (eventsCount > _bufferSize) {
|
||||
spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
|
||||
}
|
||||
|
||||
if (spliceCount > 0) {
|
||||
_events.splice(0, spliceCount);
|
||||
}
|
||||
|
||||
return _events;
|
||||
}
|
||||
}
|
||||
|
||||
class ReplayEvent<T> {
|
||||
constructor(public time: number, public value: T) {
|
||||
}
|
||||
}
|
5
node_modules/rxjs/src/Rx.global.js
generated
vendored
Normal file
5
node_modules/rxjs/src/Rx.global.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(function (root, factory) {
|
||||
root.Rx = factory();
|
||||
})(window || global || this, function () {
|
||||
return require('../dist/package/Rx');
|
||||
});
|
227
node_modules/rxjs/src/Rx.ts
generated
vendored
Normal file
227
node_modules/rxjs/src/Rx.ts
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
/* tslint:disable:no-unused-variable */
|
||||
// Subject imported before Observable to bypass circular dependency issue since
|
||||
// Subject extends Observable and Observable references Subject in it's
|
||||
// definition
|
||||
export {Subject, AnonymousSubject} from './Subject';
|
||||
/* tslint:enable:no-unused-variable */
|
||||
export {Observable} from './Observable';
|
||||
|
||||
// statics
|
||||
/* tslint:disable:no-use-before-declare */
|
||||
import './add/observable/bindCallback';
|
||||
import './add/observable/bindNodeCallback';
|
||||
import './add/observable/combineLatest';
|
||||
import './add/observable/concat';
|
||||
import './add/observable/defer';
|
||||
import './add/observable/empty';
|
||||
import './add/observable/forkJoin';
|
||||
import './add/observable/from';
|
||||
import './add/observable/fromEvent';
|
||||
import './add/observable/fromEventPattern';
|
||||
import './add/observable/fromPromise';
|
||||
import './add/observable/generate';
|
||||
import './add/observable/if';
|
||||
import './add/observable/interval';
|
||||
import './add/observable/merge';
|
||||
import './add/observable/race';
|
||||
import './add/observable/never';
|
||||
import './add/observable/of';
|
||||
import './add/observable/onErrorResumeNext';
|
||||
import './add/observable/pairs';
|
||||
import './add/observable/range';
|
||||
import './add/observable/using';
|
||||
import './add/observable/throw';
|
||||
import './add/observable/timer';
|
||||
import './add/observable/zip';
|
||||
|
||||
//dom
|
||||
import './add/observable/dom/ajax';
|
||||
import './add/observable/dom/webSocket';
|
||||
|
||||
//operators
|
||||
import './add/operator/buffer';
|
||||
import './add/operator/bufferCount';
|
||||
import './add/operator/bufferTime';
|
||||
import './add/operator/bufferToggle';
|
||||
import './add/operator/bufferWhen';
|
||||
import './add/operator/catch';
|
||||
import './add/operator/combineAll';
|
||||
import './add/operator/combineLatest';
|
||||
import './add/operator/concat';
|
||||
import './add/operator/concatAll';
|
||||
import './add/operator/concatMap';
|
||||
import './add/operator/concatMapTo';
|
||||
import './add/operator/count';
|
||||
import './add/operator/dematerialize';
|
||||
import './add/operator/debounce';
|
||||
import './add/operator/debounceTime';
|
||||
import './add/operator/defaultIfEmpty';
|
||||
import './add/operator/delay';
|
||||
import './add/operator/delayWhen';
|
||||
import './add/operator/distinct';
|
||||
import './add/operator/distinctUntilChanged';
|
||||
import './add/operator/distinctUntilKeyChanged';
|
||||
import './add/operator/do';
|
||||
import './add/operator/exhaust';
|
||||
import './add/operator/exhaustMap';
|
||||
import './add/operator/expand';
|
||||
import './add/operator/elementAt';
|
||||
import './add/operator/filter';
|
||||
import './add/operator/finally';
|
||||
import './add/operator/find';
|
||||
import './add/operator/findIndex';
|
||||
import './add/operator/first';
|
||||
import './add/operator/groupBy';
|
||||
import './add/operator/ignoreElements';
|
||||
import './add/operator/isEmpty';
|
||||
import './add/operator/audit';
|
||||
import './add/operator/auditTime';
|
||||
import './add/operator/last';
|
||||
import './add/operator/let';
|
||||
import './add/operator/every';
|
||||
import './add/operator/map';
|
||||
import './add/operator/mapTo';
|
||||
import './add/operator/materialize';
|
||||
import './add/operator/max';
|
||||
import './add/operator/merge';
|
||||
import './add/operator/mergeAll';
|
||||
import './add/operator/mergeMap';
|
||||
import './add/operator/mergeMapTo';
|
||||
import './add/operator/mergeScan';
|
||||
import './add/operator/min';
|
||||
import './add/operator/multicast';
|
||||
import './add/operator/observeOn';
|
||||
import './add/operator/onErrorResumeNext';
|
||||
import './add/operator/pairwise';
|
||||
import './add/operator/partition';
|
||||
import './add/operator/pluck';
|
||||
import './add/operator/publish';
|
||||
import './add/operator/publishBehavior';
|
||||
import './add/operator/publishReplay';
|
||||
import './add/operator/publishLast';
|
||||
import './add/operator/race';
|
||||
import './add/operator/reduce';
|
||||
import './add/operator/repeat';
|
||||
import './add/operator/repeatWhen';
|
||||
import './add/operator/retry';
|
||||
import './add/operator/retryWhen';
|
||||
import './add/operator/sample';
|
||||
import './add/operator/sampleTime';
|
||||
import './add/operator/scan';
|
||||
import './add/operator/sequenceEqual';
|
||||
import './add/operator/share';
|
||||
import './add/operator/shareReplay';
|
||||
import './add/operator/single';
|
||||
import './add/operator/skip';
|
||||
import './add/operator/skipLast';
|
||||
import './add/operator/skipUntil';
|
||||
import './add/operator/skipWhile';
|
||||
import './add/operator/startWith';
|
||||
import './add/operator/subscribeOn';
|
||||
import './add/operator/switch';
|
||||
import './add/operator/switchMap';
|
||||
import './add/operator/switchMapTo';
|
||||
import './add/operator/take';
|
||||
import './add/operator/takeLast';
|
||||
import './add/operator/takeUntil';
|
||||
import './add/operator/takeWhile';
|
||||
import './add/operator/throttle';
|
||||
import './add/operator/throttleTime';
|
||||
import './add/operator/timeInterval';
|
||||
import './add/operator/timeout';
|
||||
import './add/operator/timeoutWith';
|
||||
import './add/operator/timestamp';
|
||||
import './add/operator/toArray';
|
||||
import './add/operator/toPromise';
|
||||
import './add/operator/window';
|
||||
import './add/operator/windowCount';
|
||||
import './add/operator/windowTime';
|
||||
import './add/operator/windowToggle';
|
||||
import './add/operator/windowWhen';
|
||||
import './add/operator/withLatestFrom';
|
||||
import './add/operator/zip';
|
||||
import './add/operator/zipAll';
|
||||
|
||||
/* tslint:disable:no-unused-variable */
|
||||
export {Operator} from './Operator';
|
||||
export {Observer} from './Observer';
|
||||
export {Subscription} from './Subscription';
|
||||
export {Subscriber} from './Subscriber';
|
||||
export {AsyncSubject} from './AsyncSubject';
|
||||
export {ReplaySubject} from './ReplaySubject';
|
||||
export {BehaviorSubject} from './BehaviorSubject';
|
||||
export {ConnectableObservable} from './observable/ConnectableObservable';
|
||||
export {Notification} from './Notification';
|
||||
export {EmptyError} from './util/EmptyError';
|
||||
export {ArgumentOutOfRangeError} from './util/ArgumentOutOfRangeError';
|
||||
export {ObjectUnsubscribedError} from './util/ObjectUnsubscribedError';
|
||||
export {TimeoutError} from './util/TimeoutError';
|
||||
export {UnsubscriptionError} from './util/UnsubscriptionError';
|
||||
export {TimeInterval} from './operator/timeInterval';
|
||||
export {Timestamp} from './operators/timestamp';
|
||||
export {TestScheduler} from './testing/TestScheduler';
|
||||
export {VirtualTimeScheduler} from './scheduler/VirtualTimeScheduler';
|
||||
export {AjaxRequest, AjaxResponse, AjaxError, AjaxTimeoutError} from './observable/dom/AjaxObservable';
|
||||
export { pipe } from './util/pipe';
|
||||
|
||||
import { asap } from './scheduler/asap';
|
||||
import { async } from './scheduler/async';
|
||||
import { queue } from './scheduler/queue';
|
||||
import { animationFrame } from './scheduler/animationFrame';
|
||||
import { AsapScheduler } from './scheduler/AsapScheduler';
|
||||
import { AsyncScheduler } from './scheduler/AsyncScheduler';
|
||||
import { QueueScheduler } from './scheduler/QueueScheduler';
|
||||
import { AnimationFrameScheduler } from './scheduler/AnimationFrameScheduler';
|
||||
import { rxSubscriber } from './symbol/rxSubscriber';
|
||||
import { iterator } from './symbol/iterator';
|
||||
import { observable } from './symbol/observable';
|
||||
|
||||
import * as _operators from './operators';
|
||||
|
||||
export const operators = _operators;
|
||||
|
||||
/* tslint:enable:no-unused-variable */
|
||||
|
||||
/**
|
||||
* @typedef {Object} Rx.Scheduler
|
||||
* @property {Scheduler} queue Schedules on a queue in the current event frame
|
||||
* (trampoline scheduler). Use this for iteration operations.
|
||||
* @property {Scheduler} asap Schedules on the micro task queue, which uses the
|
||||
* fastest transport mechanism available, either Node.js' `process.nextTick()`
|
||||
* or Web Worker MessageChannel or setTimeout or others. Use this for
|
||||
* asynchronous conversions.
|
||||
* @property {Scheduler} async Schedules work with `setInterval`. Use this for
|
||||
* time-based operations.
|
||||
* @property {Scheduler} animationFrame Schedules work with `requestAnimationFrame`.
|
||||
* Use this for synchronizing with the platform's painting
|
||||
*/
|
||||
let Scheduler = {
|
||||
asap,
|
||||
queue,
|
||||
animationFrame,
|
||||
async
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} Rx.Symbol
|
||||
* @property {Symbol|string} rxSubscriber A symbol to use as a property name to
|
||||
* retrieve an "Rx safe" Observer from an object. "Rx safety" can be defined as
|
||||
* an object that has all of the traits of an Rx Subscriber, including the
|
||||
* ability to add and remove subscriptions to the subscription chain and
|
||||
* guarantees involving event triggering (can't "next" after unsubscription,
|
||||
* etc).
|
||||
* @property {Symbol|string} observable A symbol to use as a property name to
|
||||
* retrieve an Observable as defined by the [ECMAScript "Observable" spec](https://github.com/zenparsing/es-observable).
|
||||
* @property {Symbol|string} iterator The ES6 symbol to use as a property name
|
||||
* to retrieve an iterator from an object.
|
||||
*/
|
||||
let Symbol = {
|
||||
rxSubscriber,
|
||||
observable,
|
||||
iterator
|
||||
};
|
||||
|
||||
export {
|
||||
Scheduler,
|
||||
Symbol
|
||||
};
|
63
node_modules/rxjs/src/Scheduler.ts
generated
vendored
Normal file
63
node_modules/rxjs/src/Scheduler.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import { Action } from './scheduler/Action';
|
||||
import { Subscription } from './Subscription';
|
||||
|
||||
export interface IScheduler {
|
||||
now(): number;
|
||||
schedule<T>(work: (this: Action<T>, state?: T) => void, delay?: number, state?: T): Subscription;
|
||||
}
|
||||
/**
|
||||
* An execution context and a data structure to order tasks and schedule their
|
||||
* execution. Provides a notion of (potentially virtual) time, through the
|
||||
* `now()` getter method.
|
||||
*
|
||||
* Each unit of work in a Scheduler is called an {@link Action}.
|
||||
*
|
||||
* ```ts
|
||||
* class Scheduler {
|
||||
* now(): number;
|
||||
* schedule(work, delay?, state?): Subscription;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @class Scheduler
|
||||
*/
|
||||
export class Scheduler implements IScheduler {
|
||||
|
||||
public static now: () => number = Date.now ? Date.now : () => +new Date();
|
||||
|
||||
constructor(private SchedulerAction: typeof Action,
|
||||
now: () => number = Scheduler.now) {
|
||||
this.now = now;
|
||||
}
|
||||
|
||||
/**
|
||||
* A getter method that returns a number representing the current time
|
||||
* (at the time this function was called) according to the scheduler's own
|
||||
* internal clock.
|
||||
* @return {number} A number that represents the current time. May or may not
|
||||
* have a relation to wall-clock time. May or may not refer to a time unit
|
||||
* (e.g. milliseconds).
|
||||
*/
|
||||
public now: () => number;
|
||||
|
||||
/**
|
||||
* Schedules a function, `work`, for execution. May happen at some point in
|
||||
* the future, according to the `delay` parameter, if specified. May be passed
|
||||
* some context object, `state`, which will be passed to the `work` function.
|
||||
*
|
||||
* The given arguments will be processed an stored as an Action object in a
|
||||
* queue of actions.
|
||||
*
|
||||
* @param {function(state: ?T): ?Subscription} work A function representing a
|
||||
* task, or some unit of work to be executed by the Scheduler.
|
||||
* @param {number} [delay] Time to wait before executing the work, where the
|
||||
* time unit is implicit and defined by the Scheduler itself.
|
||||
* @param {T} [state] Some contextual data that the `work` function uses when
|
||||
* called by the Scheduler.
|
||||
* @return {Subscription} A subscription in order to be able to unsubscribe
|
||||
* the scheduled work.
|
||||
*/
|
||||
public schedule<T>(work: (this: Action<T>, state?: T) => void, delay: number = 0, state?: T): Subscription {
|
||||
return new this.SchedulerAction<T>(this, work).schedule(state, delay);
|
||||
}
|
||||
}
|
170
node_modules/rxjs/src/Subject.ts
generated
vendored
Normal file
170
node_modules/rxjs/src/Subject.ts
generated
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
import { Operator } from './Operator';
|
||||
import { Observer } from './Observer';
|
||||
import { Observable } from './Observable';
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { ISubscription, Subscription, TeardownLogic } from './Subscription';
|
||||
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
|
||||
import { SubjectSubscription } from './SubjectSubscription';
|
||||
import { rxSubscriber as rxSubscriberSymbol } from './symbol/rxSubscriber';
|
||||
|
||||
/**
|
||||
* @class SubjectSubscriber<T>
|
||||
*/
|
||||
export class SubjectSubscriber<T> extends Subscriber<T> {
|
||||
constructor(protected destination: Subject<T>) {
|
||||
super(destination);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class Subject<T>
|
||||
*/
|
||||
export class Subject<T> extends Observable<T> implements ISubscription {
|
||||
|
||||
[rxSubscriberSymbol]() {
|
||||
return new SubjectSubscriber(this);
|
||||
}
|
||||
|
||||
observers: Observer<T>[] = [];
|
||||
|
||||
closed = false;
|
||||
|
||||
isStopped = false;
|
||||
|
||||
hasError = false;
|
||||
|
||||
thrownError: any = null;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
static create: Function = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {
|
||||
return new AnonymousSubject<T>(destination, source);
|
||||
}
|
||||
|
||||
lift<R>(operator: Operator<T, R>): Observable<R> {
|
||||
const subject = new AnonymousSubject(this, this);
|
||||
subject.operator = <any>operator;
|
||||
return <any>subject;
|
||||
}
|
||||
|
||||
next(value?: T) {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
}
|
||||
if (!this.isStopped) {
|
||||
const { observers } = this;
|
||||
const len = observers.length;
|
||||
const copy = observers.slice();
|
||||
for (let i = 0; i < len; i++) {
|
||||
copy[i].next(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
error(err: any) {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
}
|
||||
this.hasError = true;
|
||||
this.thrownError = err;
|
||||
this.isStopped = true;
|
||||
const { observers } = this;
|
||||
const len = observers.length;
|
||||
const copy = observers.slice();
|
||||
for (let i = 0; i < len; i++) {
|
||||
copy[i].error(err);
|
||||
}
|
||||
this.observers.length = 0;
|
||||
}
|
||||
|
||||
complete() {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
}
|
||||
this.isStopped = true;
|
||||
const { observers } = this;
|
||||
const len = observers.length;
|
||||
const copy = observers.slice();
|
||||
for (let i = 0; i < len; i++) {
|
||||
copy[i].complete();
|
||||
}
|
||||
this.observers.length = 0;
|
||||
}
|
||||
|
||||
unsubscribe() {
|
||||
this.isStopped = true;
|
||||
this.closed = true;
|
||||
this.observers = null;
|
||||
}
|
||||
|
||||
protected _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
} else {
|
||||
return super._trySubscribe(subscriber);
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated internal use only */ _subscribe(subscriber: Subscriber<T>): Subscription {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
} else if (this.hasError) {
|
||||
subscriber.error(this.thrownError);
|
||||
return Subscription.EMPTY;
|
||||
} else if (this.isStopped) {
|
||||
subscriber.complete();
|
||||
return Subscription.EMPTY;
|
||||
} else {
|
||||
this.observers.push(subscriber);
|
||||
return new SubjectSubscription(this, subscriber);
|
||||
}
|
||||
}
|
||||
|
||||
asObservable(): Observable<T> {
|
||||
const observable = new Observable<T>();
|
||||
(<any>observable).source = this;
|
||||
return observable;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class AnonymousSubject<T>
|
||||
*/
|
||||
export class AnonymousSubject<T> extends Subject<T> {
|
||||
constructor(protected destination?: Observer<T>, source?: Observable<T>) {
|
||||
super();
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
next(value: T) {
|
||||
const { destination } = this;
|
||||
if (destination && destination.next) {
|
||||
destination.next(value);
|
||||
}
|
||||
}
|
||||
|
||||
error(err: any) {
|
||||
const { destination } = this;
|
||||
if (destination && destination.error) {
|
||||
this.destination.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
complete() {
|
||||
const { destination } = this;
|
||||
if (destination && destination.complete) {
|
||||
this.destination.complete();
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated internal use only */ _subscribe(subscriber: Subscriber<T>): Subscription {
|
||||
const { source } = this;
|
||||
if (source) {
|
||||
return this.source.subscribe(subscriber);
|
||||
} else {
|
||||
return Subscription.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
39
node_modules/rxjs/src/SubjectSubscription.ts
generated
vendored
Normal file
39
node_modules/rxjs/src/SubjectSubscription.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Subject } from './Subject';
|
||||
import { Observer } from './Observer';
|
||||
import { Subscription } from './Subscription';
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
export class SubjectSubscription<T> extends Subscription {
|
||||
closed: boolean = false;
|
||||
|
||||
constructor(public subject: Subject<T>, public subscriber: Observer<T>) {
|
||||
super();
|
||||
}
|
||||
|
||||
unsubscribe() {
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.closed = true;
|
||||
|
||||
const subject = this.subject;
|
||||
const observers = subject.observers;
|
||||
|
||||
this.subject = null;
|
||||
|
||||
if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const subscriberIndex = observers.indexOf(this.subscriber);
|
||||
|
||||
if (subscriberIndex !== -1) {
|
||||
observers.splice(subscriberIndex, 1);
|
||||
}
|
||||
}
|
||||
}
|
286
node_modules/rxjs/src/Subscriber.ts
generated
vendored
Normal file
286
node_modules/rxjs/src/Subscriber.ts
generated
vendored
Normal file
@@ -0,0 +1,286 @@
|
||||
import { isFunction } from './util/isFunction';
|
||||
import { Observer, PartialObserver } from './Observer';
|
||||
import { Subscription } from './Subscription';
|
||||
import { empty as emptyObserver } from './Observer';
|
||||
import { rxSubscriber as rxSubscriberSymbol } from './symbol/rxSubscriber';
|
||||
|
||||
/**
|
||||
* Implements the {@link Observer} interface and extends the
|
||||
* {@link Subscription} class. While the {@link Observer} is the public API for
|
||||
* consuming the values of an {@link Observable}, all Observers get converted to
|
||||
* a Subscriber, in order to provide Subscription-like capabilities such as
|
||||
* `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
|
||||
* implementing operators, but it is rarely used as a public API.
|
||||
*
|
||||
* @class Subscriber<T>
|
||||
*/
|
||||
export class Subscriber<T> extends Subscription implements Observer<T> {
|
||||
|
||||
[rxSubscriberSymbol]() { return this; }
|
||||
|
||||
/**
|
||||
* A static factory for a Subscriber, given a (potentially partial) definition
|
||||
* of an Observer.
|
||||
* @param {function(x: ?T): void} [next] The `next` callback of an Observer.
|
||||
* @param {function(e: ?any): void} [error] The `error` callback of an
|
||||
* Observer.
|
||||
* @param {function(): void} [complete] The `complete` callback of an
|
||||
* Observer.
|
||||
* @return {Subscriber<T>} A Subscriber wrapping the (partially defined)
|
||||
* Observer represented by the given arguments.
|
||||
*/
|
||||
static create<T>(next?: (x?: T) => void,
|
||||
error?: (e?: any) => void,
|
||||
complete?: () => void): Subscriber<T> {
|
||||
const subscriber = new Subscriber(next, error, complete);
|
||||
subscriber.syncErrorThrowable = false;
|
||||
return subscriber;
|
||||
}
|
||||
|
||||
public syncErrorValue: any = null;
|
||||
public syncErrorThrown: boolean = false;
|
||||
public syncErrorThrowable: boolean = false;
|
||||
|
||||
protected isStopped: boolean = false;
|
||||
protected destination: PartialObserver<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)
|
||||
|
||||
/**
|
||||
* @param {Observer|function(value: T): void} [destinationOrNext] A partially
|
||||
* defined Observer or a `next` callback function.
|
||||
* @param {function(e: ?any): void} [error] The `error` callback of an
|
||||
* Observer.
|
||||
* @param {function(): void} [complete] The `complete` callback of an
|
||||
* Observer.
|
||||
*/
|
||||
constructor(destinationOrNext?: PartialObserver<any> | ((value: T) => void),
|
||||
error?: (e?: any) => void,
|
||||
complete?: () => void) {
|
||||
super();
|
||||
|
||||
switch (arguments.length) {
|
||||
case 0:
|
||||
this.destination = emptyObserver;
|
||||
break;
|
||||
case 1:
|
||||
if (!destinationOrNext) {
|
||||
this.destination = emptyObserver;
|
||||
break;
|
||||
}
|
||||
if (typeof destinationOrNext === 'object') {
|
||||
// HACK(benlesh): To resolve an issue where Node users may have multiple
|
||||
// copies of rxjs in their node_modules directory.
|
||||
if (isTrustedSubscriber(destinationOrNext)) {
|
||||
const trustedSubscriber = destinationOrNext[rxSubscriberSymbol]() as Subscriber<any>;
|
||||
this.syncErrorThrowable = trustedSubscriber.syncErrorThrowable;
|
||||
this.destination = trustedSubscriber;
|
||||
trustedSubscriber.add(this);
|
||||
} else {
|
||||
this.syncErrorThrowable = true;
|
||||
this.destination = new SafeSubscriber<T>(this, <PartialObserver<any>> destinationOrNext);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
this.syncErrorThrowable = true;
|
||||
this.destination = new SafeSubscriber<T>(this, <((value: T) => void)> destinationOrNext, error, complete);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link Observer} callback to receive notifications of type `next` from
|
||||
* the Observable, with a value. The Observable may call this method 0 or more
|
||||
* times.
|
||||
* @param {T} [value] The `next` value.
|
||||
* @return {void}
|
||||
*/
|
||||
next(value?: T): void {
|
||||
if (!this.isStopped) {
|
||||
this._next(value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link Observer} callback to receive notifications of type `error` from
|
||||
* the Observable, with an attached {@link Error}. Notifies the Observer that
|
||||
* the Observable has experienced an error condition.
|
||||
* @param {any} [err] The `error` exception.
|
||||
* @return {void}
|
||||
*/
|
||||
error(err?: any): void {
|
||||
if (!this.isStopped) {
|
||||
this.isStopped = true;
|
||||
this._error(err);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link Observer} callback to receive a valueless notification of type
|
||||
* `complete` from the Observable. Notifies the Observer that the Observable
|
||||
* has finished sending push-based notifications.
|
||||
* @return {void}
|
||||
*/
|
||||
complete(): void {
|
||||
if (!this.isStopped) {
|
||||
this.isStopped = true;
|
||||
this._complete();
|
||||
}
|
||||
}
|
||||
|
||||
unsubscribe(): void {
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
this.isStopped = true;
|
||||
super.unsubscribe();
|
||||
}
|
||||
|
||||
protected _next(value: T): void {
|
||||
this.destination.next(value);
|
||||
}
|
||||
|
||||
protected _error(err: any): void {
|
||||
this.destination.error(err);
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
||||
protected _complete(): void {
|
||||
this.destination.complete();
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
||||
/** @deprecated internal use only */ _unsubscribeAndRecycle(): Subscriber<T> {
|
||||
const { _parent, _parents } = this;
|
||||
this._parent = null;
|
||||
this._parents = null;
|
||||
this.unsubscribe();
|
||||
this.closed = false;
|
||||
this.isStopped = false;
|
||||
this._parent = _parent;
|
||||
this._parents = _parents;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
class SafeSubscriber<T> extends Subscriber<T> {
|
||||
|
||||
private _context: any;
|
||||
|
||||
constructor(private _parentSubscriber: Subscriber<T>,
|
||||
observerOrNext?: PartialObserver<T> | ((value: T) => void),
|
||||
error?: (e?: any) => void,
|
||||
complete?: () => void) {
|
||||
super();
|
||||
|
||||
let next: ((value: T) => void);
|
||||
let context: any = this;
|
||||
|
||||
if (isFunction(observerOrNext)) {
|
||||
next = (<((value: T) => void)> observerOrNext);
|
||||
} else if (observerOrNext) {
|
||||
next = (<PartialObserver<T>> observerOrNext).next;
|
||||
error = (<PartialObserver<T>> observerOrNext).error;
|
||||
complete = (<PartialObserver<T>> observerOrNext).complete;
|
||||
if (observerOrNext !== emptyObserver) {
|
||||
context = Object.create(observerOrNext);
|
||||
if (isFunction(context.unsubscribe)) {
|
||||
this.add(<() => void> context.unsubscribe.bind(context));
|
||||
}
|
||||
context.unsubscribe = this.unsubscribe.bind(this);
|
||||
}
|
||||
}
|
||||
|
||||
this._context = context;
|
||||
this._next = next;
|
||||
this._error = error;
|
||||
this._complete = complete;
|
||||
}
|
||||
|
||||
next(value?: T): void {
|
||||
if (!this.isStopped && this._next) {
|
||||
const { _parentSubscriber } = this;
|
||||
if (!_parentSubscriber.syncErrorThrowable) {
|
||||
this.__tryOrUnsub(this._next, value);
|
||||
} else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
||||
this.unsubscribe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
error(err?: any): void {
|
||||
if (!this.isStopped) {
|
||||
const { _parentSubscriber } = this;
|
||||
if (this._error) {
|
||||
if (!_parentSubscriber.syncErrorThrowable) {
|
||||
this.__tryOrUnsub(this._error, err);
|
||||
this.unsubscribe();
|
||||
} else {
|
||||
this.__tryOrSetError(_parentSubscriber, this._error, err);
|
||||
this.unsubscribe();
|
||||
}
|
||||
} else if (!_parentSubscriber.syncErrorThrowable) {
|
||||
this.unsubscribe();
|
||||
throw err;
|
||||
} else {
|
||||
_parentSubscriber.syncErrorValue = err;
|
||||
_parentSubscriber.syncErrorThrown = true;
|
||||
this.unsubscribe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
complete(): void {
|
||||
if (!this.isStopped) {
|
||||
const { _parentSubscriber } = this;
|
||||
if (this._complete) {
|
||||
const wrappedComplete = () => this._complete.call(this._context);
|
||||
|
||||
if (!_parentSubscriber.syncErrorThrowable) {
|
||||
this.__tryOrUnsub(wrappedComplete);
|
||||
this.unsubscribe();
|
||||
} else {
|
||||
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
||||
this.unsubscribe();
|
||||
}
|
||||
} else {
|
||||
this.unsubscribe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private __tryOrUnsub(fn: Function, value?: any): void {
|
||||
try {
|
||||
fn.call(this._context, value);
|
||||
} catch (err) {
|
||||
this.unsubscribe();
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
private __tryOrSetError(parent: Subscriber<T>, fn: Function, value?: any): boolean {
|
||||
try {
|
||||
fn.call(this._context, value);
|
||||
} catch (err) {
|
||||
parent.syncErrorValue = err;
|
||||
parent.syncErrorThrown = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @deprecated internal use only */ _unsubscribe(): void {
|
||||
const { _parentSubscriber } = this;
|
||||
this._context = null;
|
||||
this._parentSubscriber = null;
|
||||
_parentSubscriber.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
function isTrustedSubscriber(obj: any) {
|
||||
return obj instanceof Subscriber || ('syncErrorThrowable' in obj && obj[rxSubscriberSymbol]);
|
||||
}
|
222
node_modules/rxjs/src/Subscription.ts
generated
vendored
Normal file
222
node_modules/rxjs/src/Subscription.ts
generated
vendored
Normal file
@@ -0,0 +1,222 @@
|
||||
import { isArray } from './util/isArray';
|
||||
import { isObject } from './util/isObject';
|
||||
import { isFunction } from './util/isFunction';
|
||||
import { tryCatch } from './util/tryCatch';
|
||||
import { errorObject } from './util/errorObject';
|
||||
import { UnsubscriptionError } from './util/UnsubscriptionError';
|
||||
|
||||
export interface AnonymousSubscription {
|
||||
unsubscribe(): void;
|
||||
}
|
||||
|
||||
export type TeardownLogic = AnonymousSubscription | Function | void;
|
||||
|
||||
export interface ISubscription extends AnonymousSubscription {
|
||||
unsubscribe(): void;
|
||||
readonly closed: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a disposable resource, such as the execution of an Observable. A
|
||||
* Subscription has one important method, `unsubscribe`, that takes no argument
|
||||
* and just disposes the resource held by the subscription.
|
||||
*
|
||||
* Additionally, subscriptions may be grouped together through the `add()`
|
||||
* method, which will attach a child Subscription to the current Subscription.
|
||||
* When a Subscription is unsubscribed, all its children (and its grandchildren)
|
||||
* will be unsubscribed as well.
|
||||
*
|
||||
* @class Subscription
|
||||
*/
|
||||
export class Subscription implements ISubscription {
|
||||
public static EMPTY: Subscription = (function(empty: any){
|
||||
empty.closed = true;
|
||||
return empty;
|
||||
}(new Subscription()));
|
||||
|
||||
/**
|
||||
* A flag to indicate whether this Subscription has already been unsubscribed.
|
||||
* @type {boolean}
|
||||
*/
|
||||
public closed: boolean = false;
|
||||
|
||||
protected _parent: Subscription = null;
|
||||
protected _parents: Subscription[] = null;
|
||||
private _subscriptions: ISubscription[] = null;
|
||||
|
||||
/**
|
||||
* @param {function(): void} [unsubscribe] A function describing how to
|
||||
* perform the disposal of resources when the `unsubscribe` method is called.
|
||||
*/
|
||||
constructor(unsubscribe?: () => void) {
|
||||
if (unsubscribe) {
|
||||
(<any> this)._unsubscribe = unsubscribe;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disposes the resources held by the subscription. May, for instance, cancel
|
||||
* an ongoing Observable execution or cancel any other type of work that
|
||||
* started when the Subscription was created.
|
||||
* @return {void}
|
||||
*/
|
||||
unsubscribe(): void {
|
||||
let hasErrors = false;
|
||||
let errors: any[];
|
||||
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
let { _parent, _parents, _unsubscribe, _subscriptions } = (<any> this);
|
||||
|
||||
this.closed = true;
|
||||
this._parent = null;
|
||||
this._parents = null;
|
||||
// null out _subscriptions first so any child subscriptions that attempt
|
||||
// to remove themselves from this subscription will noop
|
||||
this._subscriptions = null;
|
||||
|
||||
let index = -1;
|
||||
let len = _parents ? _parents.length : 0;
|
||||
|
||||
// if this._parent is null, then so is this._parents, and we
|
||||
// don't have to remove ourselves from any parent subscriptions.
|
||||
while (_parent) {
|
||||
_parent.remove(this);
|
||||
// if this._parents is null or index >= len,
|
||||
// then _parent is set to null, and the loop exits
|
||||
_parent = ++index < len && _parents[index] || null;
|
||||
}
|
||||
|
||||
if (isFunction(_unsubscribe)) {
|
||||
let trial = tryCatch(_unsubscribe).call(this);
|
||||
if (trial === errorObject) {
|
||||
hasErrors = true;
|
||||
errors = errors || (
|
||||
errorObject.e instanceof UnsubscriptionError ?
|
||||
flattenUnsubscriptionErrors(errorObject.e.errors) : [errorObject.e]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isArray(_subscriptions)) {
|
||||
|
||||
index = -1;
|
||||
len = _subscriptions.length;
|
||||
|
||||
while (++index < len) {
|
||||
const sub = _subscriptions[index];
|
||||
if (isObject(sub)) {
|
||||
let trial = tryCatch(sub.unsubscribe).call(sub);
|
||||
if (trial === errorObject) {
|
||||
hasErrors = true;
|
||||
errors = errors || [];
|
||||
let err = errorObject.e;
|
||||
if (err instanceof UnsubscriptionError) {
|
||||
errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
|
||||
} else {
|
||||
errors.push(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasErrors) {
|
||||
throw new UnsubscriptionError(errors);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a tear down to be called during the unsubscribe() of this
|
||||
* Subscription.
|
||||
*
|
||||
* If the tear down being added is a subscription that is already
|
||||
* unsubscribed, is the same reference `add` is being called on, or is
|
||||
* `Subscription.EMPTY`, it will not be added.
|
||||
*
|
||||
* If this subscription is already in an `closed` state, the passed
|
||||
* tear down logic will be executed immediately.
|
||||
*
|
||||
* @param {TeardownLogic} teardown The additional logic to execute on
|
||||
* teardown.
|
||||
* @return {Subscription} Returns the Subscription used or created to be
|
||||
* added to the inner subscriptions list. This Subscription can be used with
|
||||
* `remove()` to remove the passed teardown logic from the inner subscriptions
|
||||
* list.
|
||||
*/
|
||||
add(teardown: TeardownLogic): Subscription {
|
||||
if (!teardown || (teardown === Subscription.EMPTY)) {
|
||||
return Subscription.EMPTY;
|
||||
}
|
||||
|
||||
if (teardown === this) {
|
||||
return this;
|
||||
}
|
||||
|
||||
let subscription = (<Subscription> teardown);
|
||||
|
||||
switch (typeof teardown) {
|
||||
case 'function':
|
||||
subscription = new Subscription(<(() => void) > teardown);
|
||||
case 'object':
|
||||
if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
|
||||
return subscription;
|
||||
} else if (this.closed) {
|
||||
subscription.unsubscribe();
|
||||
return subscription;
|
||||
} else if (typeof subscription._addParent !== 'function' /* quack quack */) {
|
||||
const tmp = subscription;
|
||||
subscription = new Subscription();
|
||||
subscription._subscriptions = [tmp];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
|
||||
}
|
||||
|
||||
const subscriptions = this._subscriptions || (this._subscriptions = []);
|
||||
|
||||
subscriptions.push(subscription);
|
||||
subscription._addParent(this);
|
||||
|
||||
return subscription;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a Subscription from the internal list of subscriptions that will
|
||||
* unsubscribe during the unsubscribe process of this Subscription.
|
||||
* @param {Subscription} subscription The subscription to remove.
|
||||
* @return {void}
|
||||
*/
|
||||
remove(subscription: Subscription): void {
|
||||
const subscriptions = this._subscriptions;
|
||||
if (subscriptions) {
|
||||
const subscriptionIndex = subscriptions.indexOf(subscription);
|
||||
if (subscriptionIndex !== -1) {
|
||||
subscriptions.splice(subscriptionIndex, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _addParent(parent: Subscription) {
|
||||
let { _parent, _parents } = this;
|
||||
if (!_parent || _parent === parent) {
|
||||
// If we don't have a parent, or the new parent is the same as the
|
||||
// current parent, then set this._parent to the new parent.
|
||||
this._parent = parent;
|
||||
} else if (!_parents) {
|
||||
// If there's already one parent, but not multiple, allocate an Array to
|
||||
// store the rest of the parent Subscriptions.
|
||||
this._parents = [parent];
|
||||
} else if (_parents.indexOf(parent) === -1) {
|
||||
// Only add the new parent to the _parents list if it's not already there.
|
||||
_parents.push(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function flattenUnsubscriptionErrors(errors: any[]) {
|
||||
return errors.reduce((errs, err) => errs.concat((err instanceof UnsubscriptionError) ? err.errors : err), []);
|
||||
}
|
1
node_modules/rxjs/src/WORKSPACE
generated
vendored
Normal file
1
node_modules/rxjs/src/WORKSPACE
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
workspace(name = "rxjs")
|
10
node_modules/rxjs/src/add/observable/bindCallback.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/bindCallback.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { bindCallback as staticBindCallback } from '../../observable/bindCallback';
|
||||
|
||||
Observable.bindCallback = staticBindCallback;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let bindCallback: typeof staticBindCallback;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/bindNodeCallback.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/bindNodeCallback.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { bindNodeCallback as staticBindNodeCallback } from '../../observable/bindNodeCallback';
|
||||
|
||||
Observable.bindNodeCallback = staticBindNodeCallback;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let bindNodeCallback: typeof staticBindNodeCallback;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/combineLatest.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/combineLatest.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { combineLatest as combineLatestStatic } from '../../observable/combineLatest';
|
||||
|
||||
Observable.combineLatest = combineLatestStatic;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let combineLatest: typeof combineLatestStatic;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/concat.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/concat.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { concat as concatStatic } from '../../observable/concat';
|
||||
|
||||
Observable.concat = concatStatic;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let concat: typeof concatStatic;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/defer.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/defer.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { defer as staticDefer } from '../../observable/defer';
|
||||
|
||||
Observable.defer = staticDefer;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let defer: typeof staticDefer;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/observable/dom/ajax.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/observable/dom/ajax.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Observable } from '../../../Observable';
|
||||
import { ajax as staticAjax } from '../../../observable/dom/ajax';
|
||||
import { AjaxCreationMethod } from '../../../observable/dom/AjaxObservable';
|
||||
|
||||
Observable.ajax = staticAjax;
|
||||
|
||||
declare module '../../../Observable' {
|
||||
namespace Observable {
|
||||
export let ajax: AjaxCreationMethod;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/dom/webSocket.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/dom/webSocket.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../../Observable';
|
||||
import { webSocket as staticWebSocket } from '../../../observable/dom/webSocket';
|
||||
|
||||
Observable.webSocket = staticWebSocket;
|
||||
|
||||
declare module '../../../Observable' {
|
||||
namespace Observable {
|
||||
export let webSocket: typeof staticWebSocket;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/empty.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/empty.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { empty as staticEmpty } from '../../observable/empty';
|
||||
|
||||
Observable.empty = staticEmpty;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let empty: typeof staticEmpty;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/forkJoin.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/forkJoin.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { forkJoin as staticForkJoin } from '../../observable/forkJoin';
|
||||
|
||||
Observable.forkJoin = staticForkJoin;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let forkJoin: typeof staticForkJoin;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/from.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/from.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { from as staticFrom } from '../../observable/from';
|
||||
|
||||
Observable.from = staticFrom;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let from: typeof staticFrom;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/fromEvent.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/fromEvent.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { fromEvent as staticFromEvent } from '../../observable/fromEvent';
|
||||
|
||||
Observable.fromEvent = staticFromEvent;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let fromEvent: typeof staticFromEvent;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/fromEventPattern.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/fromEventPattern.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { fromEventPattern as staticFromEventPattern } from '../../observable/fromEventPattern';
|
||||
|
||||
Observable.fromEventPattern = staticFromEventPattern;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let fromEventPattern: typeof staticFromEventPattern;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/fromPromise.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/fromPromise.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { fromPromise as staticFromPromise } from '../../observable/fromPromise';
|
||||
|
||||
Observable.fromPromise = staticFromPromise;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let fromPromise: typeof staticFromPromise;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/generate.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/generate.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { generate as staticGenerate } from '../../observable/generate';
|
||||
|
||||
Observable.generate = staticGenerate;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let generate: typeof staticGenerate;
|
||||
}
|
||||
}
|
4
node_modules/rxjs/src/add/observable/if.ts
generated
vendored
Normal file
4
node_modules/rxjs/src/add/observable/if.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { _if } from '../../observable/if';
|
||||
|
||||
Observable.if = _if;
|
10
node_modules/rxjs/src/add/observable/interval.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/interval.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { interval as staticInterval } from '../../observable/interval';
|
||||
|
||||
Observable.interval = staticInterval;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let interval: typeof staticInterval;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/merge.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/merge.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { merge as mergeStatic } from '../../observable/merge';
|
||||
|
||||
Observable.merge = mergeStatic;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let merge: typeof mergeStatic;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/never.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/never.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { never as staticNever } from '../../observable/never';
|
||||
|
||||
Observable.never = staticNever;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let never: typeof staticNever;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/of.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/of.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { of as staticOf } from '../../observable/of';
|
||||
|
||||
Observable.of = staticOf;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let of: typeof staticOf; //formOf an iceberg!
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/onErrorResumeNext.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/onErrorResumeNext.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { onErrorResumeNext as staticOnErrorResumeNext } from '../../observable/onErrorResumeNext';
|
||||
|
||||
Observable.onErrorResumeNext = staticOnErrorResumeNext;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let onErrorResumeNext: typeof staticOnErrorResumeNext;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/pairs.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/pairs.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { pairs as staticPairs } from '../../observable/pairs';
|
||||
|
||||
Observable.pairs = staticPairs;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let pairs: typeof staticPairs;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/race.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/race.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { race as staticRace } from '../../observable/race';
|
||||
|
||||
Observable.race = staticRace;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let race: typeof staticRace;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/range.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/range.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { range as staticRange } from '../../observable/range';
|
||||
|
||||
Observable.range = staticRange;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let range: typeof staticRange;
|
||||
}
|
||||
}
|
4
node_modules/rxjs/src/add/observable/throw.ts
generated
vendored
Normal file
4
node_modules/rxjs/src/add/observable/throw.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { _throw } from '../../observable/throw';
|
||||
|
||||
Observable.throw = _throw;
|
10
node_modules/rxjs/src/add/observable/timer.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/timer.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { timer as staticTimer } from '../../observable/timer';
|
||||
|
||||
Observable.timer = staticTimer;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let timer: typeof staticTimer;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/using.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/using.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { using as staticUsing } from '../../observable/using';
|
||||
|
||||
Observable.using = staticUsing;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let using: typeof staticUsing;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/observable/zip.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/observable/zip.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { zip as zipStatic } from '../../observable/zip';
|
||||
|
||||
Observable.zip = zipStatic;
|
||||
|
||||
declare module '../../Observable' {
|
||||
namespace Observable {
|
||||
export let zip: typeof zipStatic;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/operator/audit.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/operator/audit.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { audit } from '../../operator/audit';
|
||||
|
||||
Observable.prototype.audit = audit;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
audit: typeof audit;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/operator/auditTime.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/operator/auditTime.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { auditTime } from '../../operator/auditTime';
|
||||
|
||||
Observable.prototype.auditTime = auditTime;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
auditTime: typeof auditTime;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/buffer.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/buffer.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { buffer } from '../../operator/buffer';
|
||||
|
||||
Observable.prototype.buffer = buffer;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
buffer: typeof buffer;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/bufferCount.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/bufferCount.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { bufferCount } from '../../operator/bufferCount';
|
||||
|
||||
Observable.prototype.bufferCount = bufferCount;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
bufferCount: typeof bufferCount;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/bufferTime.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/bufferTime.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { bufferTime } from '../../operator/bufferTime';
|
||||
|
||||
Observable.prototype.bufferTime = bufferTime;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
bufferTime: typeof bufferTime;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/bufferToggle.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/bufferToggle.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { bufferToggle } from '../../operator/bufferToggle';
|
||||
|
||||
Observable.prototype.bufferToggle = bufferToggle;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
bufferToggle: typeof bufferToggle;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/bufferWhen.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/bufferWhen.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { bufferWhen } from '../../operator/bufferWhen';
|
||||
|
||||
Observable.prototype.bufferWhen = bufferWhen;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
bufferWhen: typeof bufferWhen;
|
||||
}
|
||||
}
|
13
node_modules/rxjs/src/add/operator/catch.ts
generated
vendored
Normal file
13
node_modules/rxjs/src/add/operator/catch.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { _catch } from '../../operator/catch';
|
||||
|
||||
Observable.prototype.catch = _catch;
|
||||
Observable.prototype._catch = _catch;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
catch: typeof _catch;
|
||||
_catch: typeof _catch;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/combineAll.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/combineAll.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { combineAll } from '../../operator/combineAll';
|
||||
|
||||
Observable.prototype.combineAll = combineAll;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
combineAll: typeof combineAll;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/combineLatest.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/combineLatest.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { combineLatest } from '../../operator/combineLatest';
|
||||
|
||||
Observable.prototype.combineLatest = combineLatest;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
combineLatest: typeof combineLatest;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/concat.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/concat.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { concat } from '../../operator/concat';
|
||||
|
||||
Observable.prototype.concat = concat;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
concat: typeof concat;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/concatAll.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/concatAll.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { concatAll } from '../../operator/concatAll';
|
||||
|
||||
Observable.prototype.concatAll = concatAll;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
concatAll: typeof concatAll;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/concatMap.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/concatMap.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { concatMap } from '../../operator/concatMap';
|
||||
|
||||
Observable.prototype.concatMap = concatMap;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
concatMap: typeof concatMap;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/concatMapTo.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/concatMapTo.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { concatMapTo } from '../../operator/concatMapTo';
|
||||
|
||||
Observable.prototype.concatMapTo = concatMapTo;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
concatMapTo: typeof concatMapTo;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/count.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/count.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { count } from '../../operator/count';
|
||||
|
||||
Observable.prototype.count = count;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
count: typeof count;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/debounce.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/debounce.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { debounce } from '../../operator/debounce';
|
||||
|
||||
Observable.prototype.debounce = debounce;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
debounce: typeof debounce;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/debounceTime.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/debounceTime.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { debounceTime } from '../../operator/debounceTime';
|
||||
|
||||
Observable.prototype.debounceTime = debounceTime;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
debounceTime: typeof debounceTime;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/defaultIfEmpty.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/defaultIfEmpty.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { defaultIfEmpty } from '../../operator/defaultIfEmpty';
|
||||
|
||||
Observable.prototype.defaultIfEmpty = defaultIfEmpty;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
defaultIfEmpty: typeof defaultIfEmpty;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/delay.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/delay.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { delay } from '../../operator/delay';
|
||||
|
||||
Observable.prototype.delay = delay;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
delay: typeof delay;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/delayWhen.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/delayWhen.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { delayWhen } from '../../operator/delayWhen';
|
||||
|
||||
Observable.prototype.delayWhen = delayWhen;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
delayWhen: typeof delayWhen;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/dematerialize.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/dematerialize.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { dematerialize } from '../../operator/dematerialize';
|
||||
|
||||
Observable.prototype.dematerialize = dematerialize;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
dematerialize: typeof dematerialize;
|
||||
}
|
||||
}
|
10
node_modules/rxjs/src/add/operator/distinct.ts
generated
vendored
Normal file
10
node_modules/rxjs/src/add/operator/distinct.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Observable } from '../../Observable';
|
||||
import { distinct } from '../../operator/distinct';
|
||||
|
||||
Observable.prototype.distinct = distinct;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
distinct: typeof distinct;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/distinctUntilChanged.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/distinctUntilChanged.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { distinctUntilChanged } from '../../operator/distinctUntilChanged';
|
||||
|
||||
Observable.prototype.distinctUntilChanged = distinctUntilChanged;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
distinctUntilChanged: typeof distinctUntilChanged;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/distinctUntilKeyChanged.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/distinctUntilKeyChanged.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { distinctUntilKeyChanged } from '../../operator/distinctUntilKeyChanged';
|
||||
|
||||
Observable.prototype.distinctUntilKeyChanged = distinctUntilKeyChanged;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
distinctUntilKeyChanged: typeof distinctUntilKeyChanged;
|
||||
}
|
||||
}
|
13
node_modules/rxjs/src/add/operator/do.ts
generated
vendored
Normal file
13
node_modules/rxjs/src/add/operator/do.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { _do } from '../../operator/do';
|
||||
|
||||
Observable.prototype.do = _do;
|
||||
Observable.prototype._do = _do;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
do: typeof _do;
|
||||
_do: typeof _do;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/elementAt.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/elementAt.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { elementAt } from '../../operator/elementAt';
|
||||
|
||||
Observable.prototype.elementAt = elementAt;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
elementAt: typeof elementAt;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/every.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/every.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { every } from '../../operator/every';
|
||||
|
||||
Observable.prototype.every = every;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
every: typeof every;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/exhaust.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/exhaust.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { exhaust } from '../../operator/exhaust';
|
||||
|
||||
Observable.prototype.exhaust = exhaust;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
exhaust: typeof exhaust;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/exhaustMap.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/exhaustMap.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { exhaustMap } from '../../operator/exhaustMap';
|
||||
|
||||
Observable.prototype.exhaustMap = exhaustMap;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
exhaustMap: typeof exhaustMap;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/expand.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/expand.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { expand } from '../../operator/expand';
|
||||
|
||||
Observable.prototype.expand = expand;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
expand: typeof expand;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/filter.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/filter.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { filter } from '../../operator/filter';
|
||||
|
||||
Observable.prototype.filter = filter;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
filter: typeof filter;
|
||||
}
|
||||
}
|
13
node_modules/rxjs/src/add/operator/finally.ts
generated
vendored
Normal file
13
node_modules/rxjs/src/add/operator/finally.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { _finally } from '../../operator/finally';
|
||||
|
||||
Observable.prototype.finally = _finally;
|
||||
Observable.prototype._finally = _finally;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
finally: typeof _finally;
|
||||
_finally: typeof _finally;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/find.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/find.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { find } from '../../operator/find';
|
||||
|
||||
Observable.prototype.find = find;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
find: typeof find;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/findIndex.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/findIndex.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { findIndex } from '../../operator/findIndex';
|
||||
|
||||
Observable.prototype.findIndex = findIndex;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
findIndex: typeof findIndex;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/first.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/first.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { first } from '../../operator/first';
|
||||
|
||||
Observable.prototype.first = <any>first;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
first: typeof first;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/groupBy.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/groupBy.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { groupBy } from '../../operator/groupBy';
|
||||
|
||||
Observable.prototype.groupBy = <any>groupBy;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
groupBy: typeof groupBy;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/ignoreElements.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/ignoreElements.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { ignoreElements } from '../../operator/ignoreElements';
|
||||
|
||||
Observable.prototype.ignoreElements = ignoreElements;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
ignoreElements: typeof ignoreElements;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/isEmpty.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/isEmpty.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { isEmpty } from '../../operator/isEmpty';
|
||||
|
||||
Observable.prototype.isEmpty = isEmpty;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
isEmpty: typeof isEmpty;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/last.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/last.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { last } from '../../operator/last';
|
||||
|
||||
Observable.prototype.last = <any>last;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
last: typeof last;
|
||||
}
|
||||
}
|
13
node_modules/rxjs/src/add/operator/let.ts
generated
vendored
Normal file
13
node_modules/rxjs/src/add/operator/let.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { letProto } from '../../operator/let';
|
||||
|
||||
Observable.prototype.let = letProto;
|
||||
Observable.prototype.letBind = letProto;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
let: typeof letProto;
|
||||
letBind: typeof letProto;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/map.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/map.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { map } from '../../operator/map';
|
||||
|
||||
Observable.prototype.map = map;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
map: typeof map;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/mapTo.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/mapTo.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { mapTo } from '../../operator/mapTo';
|
||||
|
||||
Observable.prototype.mapTo = mapTo;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
mapTo: typeof mapTo;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/materialize.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/materialize.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { materialize } from '../../operator/materialize';
|
||||
|
||||
Observable.prototype.materialize = materialize;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
materialize: typeof materialize;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/max.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/max.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { max } from '../../operator/max';
|
||||
|
||||
Observable.prototype.max = max;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
max: typeof max;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/merge.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/merge.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { merge } from '../../operator/merge';
|
||||
|
||||
Observable.prototype.merge = merge;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
merge: typeof merge;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/mergeAll.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/mergeAll.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { mergeAll } from '../../operator/mergeAll';
|
||||
|
||||
Observable.prototype.mergeAll = mergeAll;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
mergeAll: typeof mergeAll;
|
||||
}
|
||||
}
|
13
node_modules/rxjs/src/add/operator/mergeMap.ts
generated
vendored
Normal file
13
node_modules/rxjs/src/add/operator/mergeMap.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { mergeMap } from '../../operator/mergeMap';
|
||||
|
||||
Observable.prototype.mergeMap = <any>mergeMap;
|
||||
Observable.prototype.flatMap = <any>mergeMap;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
flatMap: typeof mergeMap;
|
||||
mergeMap: typeof mergeMap;
|
||||
}
|
||||
}
|
13
node_modules/rxjs/src/add/operator/mergeMapTo.ts
generated
vendored
Normal file
13
node_modules/rxjs/src/add/operator/mergeMapTo.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { mergeMapTo } from '../../operator/mergeMapTo';
|
||||
|
||||
Observable.prototype.flatMapTo = <any>mergeMapTo;
|
||||
Observable.prototype.mergeMapTo = <any>mergeMapTo;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
flatMapTo: typeof mergeMapTo;
|
||||
mergeMapTo: typeof mergeMapTo;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/mergeScan.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/mergeScan.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { mergeScan } from '../../operator/mergeScan';
|
||||
|
||||
Observable.prototype.mergeScan = mergeScan;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
mergeScan: typeof mergeScan;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/min.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/min.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { min } from '../../operator/min';
|
||||
|
||||
Observable.prototype.min = min;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
min: typeof min;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/multicast.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/multicast.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { multicast } from '../../operator/multicast';
|
||||
|
||||
Observable.prototype.multicast = <any>multicast;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
multicast: typeof multicast;
|
||||
}
|
||||
}
|
11
node_modules/rxjs/src/add/operator/observeOn.ts
generated
vendored
Normal file
11
node_modules/rxjs/src/add/operator/observeOn.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
import { Observable } from '../../Observable';
|
||||
import { observeOn } from '../../operator/observeOn';
|
||||
|
||||
Observable.prototype.observeOn = observeOn;
|
||||
|
||||
declare module '../../Observable' {
|
||||
interface Observable<T> {
|
||||
observeOn: typeof observeOn;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user