ReactFire reference docs / SuspenseSubject / SuspenseSubject
SuspenseSubject.SuspenseSubject
Name |
---|
T |
-
Subject
<T
>↳
SuspenseSubject
- _error
- _firstEmission
- _hasValue
- _innerObservable
- _innerSubscriber
- _resolveFirstEmission
- _timeoutHandler
- _value
- _warmupSubscription
- closed
- hasError
- isStopped
- observers
- operator
- source
- thrownError
- create
- _next
- _reset
- _subscribe
- asObservable
- complete
- error
- forEach
- lift
- next
- pipe
- subscribe
- toPromise
- unsubscribe
• new SuspenseSubject<T
>(innerObservable
, _timeoutWindow
)
Name |
---|
T |
Name | Type |
---|---|
innerObservable |
Observable <T > |
_timeoutWindow |
number |
Subject<T>.constructor
• Private
_error: any
• Private
_firstEmission: Promise
<void
>
• Private
_hasValue: boolean
= false
• Private
_innerObservable: Observable
<T
>
• Private
_innerSubscriber: Subscription
• Private
_resolveFirstEmission: () => void
▸ (): void
void
• Private
_timeoutHandler: Timeout
• Private
_value: undefined
| T
• Private
_warmupSubscription: Subscription
• closed: boolean
Subject.closed
node_modules/rxjs/dist/types/internal/Subject.d.ts:12
• hasError: boolean
deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.
Subject.hasError
node_modules/rxjs/dist/types/internal/Subject.d.ts:18
• isStopped: boolean
deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.
Subject.isStopped
node_modules/rxjs/dist/types/internal/Subject.d.ts:16
• observers: Observer
<T
>[]
deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.
Subject.observers
node_modules/rxjs/dist/types/internal/Subject.d.ts:14
• operator: undefined
| Operator
<any
, T
>
deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.
Subject.operator
node_modules/rxjs/dist/types/internal/Observable.d.ts:22
• source: undefined
| Observable
<any
>
deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.
Subject.source
node_modules/rxjs/dist/types/internal/Observable.d.ts:18
• thrownError: any
deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.
Subject.thrownError
node_modules/rxjs/dist/types/internal/Subject.d.ts:20
▪ Static
create: (...args
: any
[]) => any
Creates a "subject" by basically gluing an observer to an observable.
nocollapse
deprecated
Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.
▸ (...args
): any
Creates a "subject" by basically gluing an observer to an observable.
nocollapse
deprecated
Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.
Name | Type |
---|---|
...args |
any [] |
any
Subject.create
node_modules/rxjs/dist/types/internal/Subject.d.ts:27
• get
firstEmission(): Promise
<void
>
Promise
<void
>
• get
hasValue(): boolean
boolean
• get
observed(): boolean
boolean
node_modules/rxjs/dist/types/internal/Subject.d.ts:35
• get
ourError(): any
any
• get
value(): T
T
▸ Private
_next(value
): void
Name | Type |
---|---|
value |
T |
void
▸ Private
_reset(): void
void
▸ _subscribe(subscriber
): Subscription
Name | Type |
---|---|
subscriber |
Subscriber <T > |
Subscription
▸ asObservable(): Observable
<T
>
Creates a new Observable with this Subject as the source. You can do this to create customize Observer-side logic of the Subject and conceal it from code that uses the Observable.
Observable
<T
>
Observable that the Subject casts to
Subject.asObservable
node_modules/rxjs/dist/types/internal/Subject.d.ts:42
▸ complete(): void
void
Subject.complete
node_modules/rxjs/dist/types/internal/Subject.d.ts:33
▸ error(err
): void
Name | Type |
---|---|
err |
any |
void
Subject.error
node_modules/rxjs/dist/types/internal/Subject.d.ts:32
▸ forEach(next
): Promise
<void
>
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 {@link timeout}, {@link take}, {@link takeWhile}, or {@link takeUntil} amongst others.
import { interval } from 'rxjs';
import { take } from 'rxjs/operators';
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"
Name | Type | Description |
---|---|---|
next |
(value : T ) => void |
a handler for each value emitted by the observable |
Promise
<void
>
a promise that either resolves on observable completion or rejects with the handled error
Subject.forEach
node_modules/rxjs/dist/types/internal/Observable.d.ts:101
▸ forEach(next
, promiseCtor
): Promise
<void
>
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.
Name | Type | Description |
---|---|---|
next |
(value : T ) => void |
a handler for each value emitted by the observable |
promiseCtor |
PromiseConstructorLike |
a constructor function used to instantiate the Promise |
Promise
<void
>
a promise that either resolves on observable completion or rejects with the handled error
Subject.forEach
node_modules/rxjs/dist/types/internal/Observable.d.ts:113
▸ lift<R
>(operator
): Observable
<R
>
deprecated
Internal implementation detail, do not use directly. Will be made internal in v8.
Name |
---|
R |
Name | Type |
---|---|
operator |
Operator <T , R > |
Observable
<R
>
Subject.lift
node_modules/rxjs/dist/types/internal/Subject.d.ts:30
▸ next(value
): void
Name | Type |
---|---|
value |
T |
void
Subject.next
node_modules/rxjs/dist/types/internal/Subject.d.ts:31
▸ pipe(): Observable
<T
>
Observable
<T
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:114
▸ pipe<A
>(op1
): Observable
<A
>
Name |
---|
A |
Name | Type |
---|---|
op1 |
OperatorFunction <T , A > |
Observable
<A
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:115
▸ pipe<A
, B
>(op1
, op2
): Observable
<B
>
Name |
---|
A |
B |
Name | Type |
---|---|
op1 |
OperatorFunction <T , A > |
op2 |
OperatorFunction <A , B > |
Observable
<B
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:116
▸ pipe<A
, B
, C
>(op1
, op2
, op3
): Observable
<C
>
Name |
---|
A |
B |
C |
Name | Type |
---|---|
op1 |
OperatorFunction <T , A > |
op2 |
OperatorFunction <A , B > |
op3 |
OperatorFunction <B , C > |
Observable
<C
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:117
▸ pipe<A
, B
, C
, D
>(op1
, op2
, op3
, op4
): Observable
<D
>
Name |
---|
A |
B |
C |
D |
Name | Type |
---|---|
op1 |
OperatorFunction <T , A > |
op2 |
OperatorFunction <A , B > |
op3 |
OperatorFunction <B , C > |
op4 |
OperatorFunction <C , D > |
Observable
<D
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:118
▸ pipe<A
, B
, C
, D
, E
>(op1
, op2
, op3
, op4
, op5
): Observable
<E
>
Name |
---|
A |
B |
C |
D |
E |
Name | Type |
---|---|
op1 |
OperatorFunction <T , A > |
op2 |
OperatorFunction <A , B > |
op3 |
OperatorFunction <B , C > |
op4 |
OperatorFunction <C , D > |
op5 |
OperatorFunction <D , E > |
Observable
<E
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:119
▸ pipe<A
, B
, C
, D
, E
, F
>(op1
, op2
, op3
, op4
, op5
, op6
): Observable
<F
>
Name |
---|
A |
B |
C |
D |
E |
F |
Name | Type |
---|---|
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
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:120
▸ pipe<A
, B
, C
, D
, E
, F
, G
>(op1
, op2
, op3
, op4
, op5
, op6
, op7
): Observable
<G
>
Name |
---|
A |
B |
C |
D |
E |
F |
G |
Name | Type |
---|---|
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
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:121
▸ pipe<A
, B
, C
, D
, E
, F
, G
, H
>(op1
, op2
, op3
, op4
, op5
, op6
, op7
, op8
): Observable
<H
>
Name |
---|
A |
B |
C |
D |
E |
F |
G |
H |
Name | Type |
---|---|
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
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:122
▸ pipe<A
, B
, C
, D
, E
, F
, G
, H
, I
>(op1
, op2
, op3
, op4
, op5
, op6
, op7
, op8
, op9
): Observable
<I
>
Name |
---|
A |
B |
C |
D |
E |
F |
G |
H |
I |
Name | Type |
---|---|
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
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:123
▸ pipe<A
, B
, C
, D
, E
, F
, G
, H
, I
>(op1
, op2
, op3
, op4
, op5
, op6
, op7
, op8
, op9
, ...operations
): Observable
<unknown
>
Name |
---|
A |
B |
C |
D |
E |
F |
G |
H |
I |
Name | Type |
---|---|
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 > |
...operations |
OperatorFunction <any , any >[] |
Observable
<unknown
>
Subject.pipe
node_modules/rxjs/dist/types/internal/Observable.d.ts:124
▸ subscribe(observer?
): Subscription
Name | Type |
---|---|
observer? |
Partial <Observer <T >> |
Subscription
Subject.subscribe
node_modules/rxjs/dist/types/internal/Observable.d.ts:53
▸ subscribe(next
): Subscription
Name | Type |
---|---|
next |
(value : T ) => void |
Subscription
Subject.subscribe
node_modules/rxjs/dist/types/internal/Observable.d.ts:54
▸ subscribe(next?
, error?
, complete?
): 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
Name | Type |
---|---|
next? |
null | (value : T ) => void |
error? |
null | (error : any ) => void |
complete? |
null | () => void |
Subscription
Subject.subscribe
node_modules/rxjs/dist/types/internal/Observable.d.ts:56
▸ toPromise(): Promise
<undefined
| T
>
deprecated
Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise
Promise
<undefined
| T
>
Subject.toPromise
node_modules/rxjs/dist/types/internal/Observable.d.ts:126
▸ toPromise(PromiseCtor
): Promise
<undefined
| T
>
deprecated
Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise
Name | Type |
---|---|
PromiseCtor |
PromiseConstructor |
Promise
<undefined
| T
>
Subject.toPromise
node_modules/rxjs/dist/types/internal/Observable.d.ts:128
▸ toPromise(PromiseCtor
): Promise
<undefined
| T
>
deprecated
Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise
Name | Type |
---|---|
PromiseCtor |
PromiseConstructorLike |
Promise
<undefined
| T
>
Subject.toPromise
node_modules/rxjs/dist/types/internal/Observable.d.ts:130
▸ unsubscribe(): void
void
Subject.unsubscribe
node_modules/rxjs/dist/types/internal/Subject.d.ts:34