RelationEntityObservable<T>
Defined in: packages/rxdb/src/entity/entity.interface.ts:94
单个关系对象的访问接口 提供对单个关联实体的观察和操作能力
Extends
Observable<InstanceType<T> |null>
Type Parameters
| Type Parameter |
|---|
T extends EntityType |
Properties
operator
operator:
| Operator<any, InstanceType<T> | null>
| 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: () => void;
Defined in: packages/rxdb/src/entity/entity.interface.ts:106
移除关联实体 相当于设置为null
Returns
void
set()
set: (entity) => void;
Defined in: packages/rxdb/src/entity/entity.interface.ts:100
设置关联实体
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | InstanceType<T> | null | 要设置的实体或 null(解除关联) |
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
| Parameter | Type | Description |
|---|---|---|
next | (value) => void | A 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
| Parameter | Type | Description |
|---|---|---|
next | (value) => void | a handler for each value emitted by the observable |
promiseCtor | PromiseConstructorLike | a 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
| Parameter | Type | Description |
|---|---|---|
operator? | Operator<InstanceType<T> | null, 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> | null>;
Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:103
Returns
Observable<InstanceType<T> | null>
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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, 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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, A> |
op2 | OperatorFunction<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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, A> |
op2 | OperatorFunction<A, B> |
op3 | OperatorFunction<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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, A> |
op2 | OperatorFunction<A, B> |
op3 | OperatorFunction<B, C> |
op4 | OperatorFunction<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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, A> |
op2 | OperatorFunction<A, B> |
op3 | OperatorFunction<B, C> |
op4 | OperatorFunction<C, D> |
op5 | OperatorFunction<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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, A> |
op2 | OperatorFunction<A, B> |
op3 | OperatorFunction<B, C> |
op4 | OperatorFunction<C, D> |
op5 | OperatorFunction<D, E> |
op6 | OperatorFunction<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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, 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> |
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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, 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> |
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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, 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> |
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
| Parameter | Type |
|---|---|
op1 | OperatorFunction<InstanceType<T> | null, 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> |
...operations | OperatorFunction<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
| Parameter | Type |
|---|---|
observerOrNext? | | Partial<Observer<InstanceType<T> | null>> | (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
| Parameter | Type |
|---|---|
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> | null | undefined>;
Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:115
Returns
Promise<InstanceType<T> | null | 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> | null | undefined>;
Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:117
Parameters
| Parameter | Type |
|---|---|
PromiseCtor | PromiseConstructor |
Returns
Promise<InstanceType<T> | null | 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> | null | undefined>;
Defined in: node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts:119
Parameters
| Parameter | Type |
|---|---|
PromiseCtor | PromiseConstructorLike |
Returns
Promise<InstanceType<T> | null | undefined>
Deprecated
Replaced with firstValueFrom and lastValueFrom. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise
Inherited from
Observable.toPromise