跳到主要内容

RelationEntitiesObservable<T>

Defined in: packages/rxdb/src/entity/entity.interface.ts:221

多个关系对象的访问接口 提供对多个关联实体集合的观察和操作能力

Extends​

  • Observable<InstanceType<T>[]>

Type Parameters​

Type Parameter
T extends EntityType

Properties​

add​

add: (...entities) => void;

Defined in: packages/rxdb/src/entity/entity.interface.ts:232

添加关联实体

Parameters​

ParameterTypeDescription
...entitiesInstanceType<T>[]要添加的实体列表

Returns​

void


count$​

count$: Observable<number>;

Defined in: packages/rxdb/src/entity/entity.interface.ts:225

关联实体数量的可观察对象


operator​

operator: Operator<any, InstanceType<T>[]> | undefined;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:17

Deprecated​

Internal implementation detail, do not use directly. Will be made internal in v8.

Inherited from​

Observable.operator

remove​

remove: (...entities) => void;

Defined in: packages/rxdb/src/entity/entity.interface.ts:239

移除关联实体

Parameters​

ParameterTypeDescription
...entitiesInstanceType<T>[]要移除的实体列表

Returns​

void


source​

source: Observable<any> | undefined;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:13

Deprecated​

Internal implementation detail, do not use directly. Will be made internal in v8.

Inherited from​

Observable.source

Methods​

forEach()​

Call Signature​

forEach(next): Promise<void>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:90

Used as a NON-CANCELLABLE means of subscribing to an observable, for use with APIs that expect promises, like async/await. You cannot unsubscribe from this.

WARNING: Only use this with observables you know will complete. If the source observable does not complete, you will end up with a promise that is hung up, and potentially all of the state of an async function hanging out in memory. To avoid this situation, look into adding something like timeout, take, takeWhile, or takeUntil amongst others.

Example​

import { interval, take } from 'rxjs';

const source$ = interval(1000).pipe(take(4));

async function getTotal() {
let total = 0;

await source$.forEach(value => {
total += value;
console.log('observable -> ' + value);
});

return total;
}

getTotal().then(
total => console.log('Total: ' + total)
);

// Expected:
// 'observable -> 0'
// 'observable -> 1'
// 'observable -> 2'
// 'observable -> 3'
// 'Total: 6'
Parameters​
ParameterTypeDescription
next(value) => voidA handler for each value emitted by the observable.
Returns​

Promise<void>

A promise that either resolves on observable completion or rejects with the handled error.

Inherited from​
Observable.forEach

Call Signature​

forEach(next, promiseCtor): Promise<void>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:102

Parameters​
ParameterTypeDescription
next(value) => voida handler for each value emitted by the observable
promiseCtorPromiseConstructorLikea constructor function used to instantiate the Promise
Returns​

Promise<void>

a promise that either resolves on observable completion or rejects with the handled error

Deprecated​

Passing a Promise constructor will no longer be available in upcoming versions of RxJS. This is because it adds weight to the library, for very little benefit. If you need this functionality, it is recommended that you either polyfill Promise, or you create an adapter to convert the returned native promise to whatever promise implementation you wanted. Will be removed in v8.

Inherited from​
Observable.forEach

lift()​

lift<R>(operator?): Observable<R>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:42

Creates a new Observable, with this Observable instance as the source, and the passed operator defined as the new observable's operator.

Type Parameters​

Type Parameter
R

Parameters​

ParameterTypeDescription
operator?Operator<InstanceType<T>[], R>the operator defining the operation to take on the observable

Returns​

Observable<R>

A new observable with the Operator applied.

Deprecated​

Internal implementation detail, do not use directly. Will be made internal in v8. If you have implemented an operator using lift, it is recommended that you create an operator by simply returning new Observable() directly. See "Creating new operators from scratch" section here: https://rxjs.dev/guide/operators

Inherited from​

Observable.lift

pipe()​

Call Signature​

pipe(): Observable<InstanceType<T>[]>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:103

Returns​

Observable<InstanceType<T>[]>

Inherited from​
Observable.pipe

Call Signature​

pipe<A>(op1): Observable<A>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:104

Type Parameters​
Type Parameter
A
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
Returns​

Observable<A>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B>(op1, op2): Observable<B>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:105

Type Parameters​
Type Parameter
A
B
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
Returns​

Observable<B>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C>(
op1,
op2,
op3
): Observable<C>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:106

Type Parameters​
Type Parameter
A
B
C
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
Returns​

Observable<C>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C, D>(
op1,
op2,
op3,
op4
): Observable<D>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:107

Type Parameters​
Type Parameter
A
B
C
D
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
Returns​

Observable<D>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C, D, E>(
op1,
op2,
op3,
op4,
op5
): Observable<E>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:108

Type Parameters​
Type Parameter
A
B
C
D
E
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
Returns​

Observable<E>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C, D, E, F>(
op1,
op2,
op3,
op4,
op5,
op6
): Observable<F>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:109

Type Parameters​
Type Parameter
A
B
C
D
E
F
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
Returns​

Observable<F>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C, D, E, F, G>(
op1,
op2,
op3,
op4,
op5,
op6,
op7
): Observable<G>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:110

Type Parameters​
Type Parameter
A
B
C
D
E
F
G
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>
Returns​

Observable<G>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C, D, E, F, G, H>(
op1,
op2,
op3,
op4,
op5,
op6,
op7,
op8
): Observable<H>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:111

Type Parameters​
Type Parameter
A
B
C
D
E
F
G
H
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>
op8OperatorFunction<G, H>
Returns​

Observable<H>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C, D, E, F, G, H, I>(
op1,
op2,
op3,
op4,
op5,
op6,
op7,
op8,
op9
): Observable<I>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:112

Type Parameters​
Type Parameter
A
B
C
D
E
F
G
H
I
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>
op8OperatorFunction<G, H>
op9OperatorFunction<H, I>
Returns​

Observable<I>

Inherited from​
Observable.pipe

Call Signature​

pipe<A, B, C, D, E, F, G, H, I>(
op1,
op2,
op3,
op4,
op5,
op6,
op7,
op8,
op9,
...operations
): Observable<unknown>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:113

Type Parameters​
Type Parameter
A
B
C
D
E
F
G
H
I
Parameters​
ParameterType
op1OperatorFunction<InstanceType<T>[], A>
op2OperatorFunction<A, B>
op3OperatorFunction<B, C>
op4OperatorFunction<C, D>
op5OperatorFunction<D, E>
op6OperatorFunction<E, F>
op7OperatorFunction<F, G>
op8OperatorFunction<G, H>
op9OperatorFunction<H, I>
...operationsOperatorFunction<any, any>[]
Returns​

Observable<unknown>

Inherited from​
Observable.pipe

subscribe()​

Call Signature​

subscribe(observerOrNext?): Subscription;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:43

Parameters​
ParameterType
observerOrNext?| Partial<Observer<InstanceType<T>[]>> | ((value) => void)
Returns​

Subscription

Inherited from​
Observable.subscribe

Call Signature​

subscribe(
next?,
error?,
complete?
): Subscription;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:45

Parameters​
ParameterType
next?((value) => void) | null
error?((error) => void) | null
complete?(() => void) | null
Returns​

Subscription

Deprecated​

Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments

Inherited from​
Observable.subscribe

toPromise()​

Call Signature​

toPromise(): Promise<InstanceType<T>[] | undefined>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:115

Returns​

Promise<InstanceType<T>[] | undefined>

Deprecated​

Replaced with firstValueFrom and lastValueFrom. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise

Inherited from​
Observable.toPromise

Call Signature​

toPromise(PromiseCtor): Promise<InstanceType<T>[] | undefined>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:117

Parameters​
ParameterType
PromiseCtorPromiseConstructor
Returns​

Promise<InstanceType<T>[] | undefined>

Deprecated​

Replaced with firstValueFrom and lastValueFrom. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise

Inherited from​
Observable.toPromise

Call Signature​

toPromise(PromiseCtor): Promise<InstanceType<T>[] | undefined>;

Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:119

Parameters​
ParameterType
PromiseCtorPromiseConstructorLike
Returns​

Promise<InstanceType<T>[] | undefined>

Deprecated​

Replaced with firstValueFrom and lastValueFrom. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise

Inherited from​
Observable.toPromise